Esempio n. 1
0
 /**
  * @dataProvider generateSet
  */
 public function testPong(Ping $ping)
 {
     $pong = new Pong($ping->getNonce());
     $this->assertEquals('pong', $pong->getNetworkCommand());
     $this->assertTrue($ping->getNonce() == $pong->getNonce());
     $math = new Math();
     $this->assertEquals(str_pad($math->decHex($ping->getNonce()), 16, '0', STR_PAD_LEFT), $pong->getHex());
 }
Esempio n. 2
0
 /**
  * @param Pong $pong
  * @return \BitWasp\Buffertools\Buffer
  */
 public function serialize(Pong $pong)
 {
     return $this->getTemplate()->write([$pong->getNonce()]);
 }