Exemplo n.º 1
0
        public async Task TransactionReceiptFilter_ForContract_Filters_Out_Empty_Addresses()
        {
            var tx = new TransactionReceipt {
                ContractAddress = null
            };
            var filter = TransactionReceiptFilter.ForContract(Address1);

            Assert.False(await filter.IsMatchAsync(tx));
        }
Exemplo n.º 2
0
        public async Task TransactionReceiptFilter_ForContract_Matches()
        {
            var tx = new TransactionReceipt {
                ContractAddress = Address1
            };
            var filter = TransactionReceiptFilter.ForContract(Address1);

            Assert.True(await filter.IsMatchAsync(tx));
        }
Exemplo n.º 3
0
        public async Task TransactionReceiptFilter_ForContract_Supports_Multiple_Contract_Addresses()
        {
            var tx1 = new TransactionReceipt {
                ContractAddress = Address1
            };
            var tx2 = new TransactionReceipt {
                ContractAddress = Address2
            };
            var tx3 = new TransactionReceipt {
                ContractAddress = UnknownAddress
            };
            var tx4 = new TransactionReceipt {
                ContractAddress = null
            };

            var filter = TransactionReceiptFilter.ForContract(new [] { Address1, Address2 });

            Assert.True(await filter.IsMatchAsync(tx1));
            Assert.True(await filter.IsMatchAsync(tx2));
            Assert.False(await filter.IsMatchAsync(tx3));
            Assert.False(await filter.IsMatchAsync(tx4));
        }