Ejemplo n.º 1
0
        public void TryDeserialize_FailTest(FastStreamReader stream, string expErr)
        {
            var addr = new NetworkAddressWithTime();

            bool b = addr.TryDeserialize(stream, out string error);

            Assert.False(b);
            Assert.Equal(expErr, error);
        }
Ejemplo n.º 2
0
        public void TryDeserializeTest()
        {
            var  addr   = new NetworkAddressWithTime();
            var  stream = new FastStreamReader(Helper.HexToBytes("d91f4854010000000000000000000000000000000000ffffc0000233208d"));
            bool b      = addr.TryDeserialize(stream, out string error);

            Assert.True(b, error);
            Assert.Null(error);
            Assert.Equal(1414012889U, addr.Time);
            Assert.Equal(NodeServiceFlags.NodeNetwork, addr.NodeServices);
            Assert.Equal(IPAddress.Parse("192.0.2.51"), addr.NodeIP);
            Assert.Equal((ushort)8333, addr.NodePort);
        }