예제 #1
0
 public NetworkPeerStorage(string baseDirectory, ChainType chainType)
     : base(Path.Combine(baseDirectory, "KnownAddresses"),
            keyEncoder: key => NetworkEncoder.EncodeNetworkAddressKey(key),
            keyDecoder: key => NetworkEncoder.DecodeNetworkAddressKey(key),
            valueEncoder: value => NetworkEncoder.EncodeNetworkAddressWithTime(value),
            valueDecoder: value => NetworkEncoder.DecodeNetworkAddressWithTime(value))
 {
 }
예제 #2
0
        public void TestWireDecodeNetworkAddressWithTime()
        {
            var actual = NetworkEncoder.EncodeNetworkAddressWithTime(NetworkEncoder.DecodeNetworkAddressWithTime(NETWORK_ADDRESS_WITH_TIME_1_BYTES.ToArray()));

            CollectionAssert.AreEqual(NETWORK_ADDRESS_WITH_TIME_1_BYTES.ToList(), actual.ToList());
        }