public function testNetworkAddressTimestamp()
 {
     $ip = '127.0.0.1';
     $port = 8333;
     $time = time();
     $services = Buffer::hex('0000000000000001');
     $from = new NetworkAddressTimestamp($time, $services, $ip, $port);
     $this->assertEquals($time, $from->getTimestamp());
     $this->assertEquals($services, $from->getServices());
     $this->assertEquals($ip, $from->getIp());
     $this->assertEquals($port, $from->getPort());
 }
 /**
  * @param NetworkAddressTimestamp $addr
  * @return Buffer
  */
 public function serialize(NetworkAddressTimestamp $addr)
 {
     return $this->getTemplate()->write([$addr->getTimestamp(), $addr->getServices(), $this->getIpBuffer($addr->getIp()), $addr->getPort()]);
 }