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)) { }
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()); }