Exemplo n.º 1
0
        public void Assigns_Event_Signature_To_Topic0()
        {
            var filter = new FilterInputBuilder <TransferEvent>().Build();

            var eventAbi = ABITypedRegistry.GetEvent <TransferEvent>();

            Assert.Equal(eventAbi.Sha3Signature.EnsureHexPrefix(), filter.Topics.FirstOrDefault());

            Assert.False(filter.IsTopicFiltered(1));
            Assert.False(filter.IsTopicFiltered(2));
            Assert.False(filter.IsTopicFiltered(3));
        }
Exemplo n.º 2
0
        public void Can_Assign_To_Topic3()
        {
            var value = BigInteger.One;

            var filter = new FilterInputBuilder <TransferEvent>()
                         .AddTopic(template => template.Value, value)
                         .Build();

            Assert.False(filter.IsTopicFiltered(1));
            Assert.False(filter.IsTopicFiltered(2));
            Assert.Equal("0x0000000000000000000000000000000000000000000000000000000000000001",
                         filter.GetFirstTopicValueAsString(3));
        }
Exemplo n.º 3
0
        public void Can_Assign_To_Topic2()
        {
            var to = "0xc14934679e71ef4d18b6ae927fe2b953c7fd9b91";

            var filter = new FilterInputBuilder <TransferEvent>()
                         .AddTopic(template => template.To, to)
                         .Build();

            Assert.False(filter.IsTopicFiltered(1));
            Assert.Equal("0x000000000000000000000000c14934679e71ef4d18b6ae927fe2b953c7fd9b91",
                         filter.GetFirstTopicValueAsString(2));
            Assert.False(filter.IsTopicFiltered(3));
        }