Пример #1
0
        public void NetworkPeerRequirementCheckForInboundWithInvalidVersionAndValidServiceReturnsFalse()
        {
            NetworkPeerRequirement networkPeerRequirement = new NetworkPeerRequirement();

            networkPeerRequirement.MinVersion       = ProtocolVersion.PROTOCOL_VERSION;
            networkPeerRequirement.RequiredServices = NetworkPeerServices.Network;
            Assert.False(networkPeerRequirement.Check(new VersionPayload()
            {
                Services = NetworkPeerServices.Network, Version = ProtocolVersion.ALT_PROTOCOL_VERSION
            }, true, out string reason));
        }
Пример #2
0
        public void NetworkPeerRequirementCheckForOutboundWithInvalidVersionAndInvalidServiceReturnsFalse()
        {
            NetworkPeerRequirement networkPeerRequirement = new NetworkPeerRequirement();

            networkPeerRequirement.MinVersion       = ProtocolVersion.SENDHEADERS_VERSION;
            networkPeerRequirement.RequiredServices = NetworkPeerServices.Network;
            Assert.False(networkPeerRequirement.Check(new VersionPayload()
            {
                Services = NetworkPeerServices.Nothing, Version = ProtocolVersion.POS_PROTOCOL_VERSION
            }, false, out string reason));
        }