Ejemplo n.º 1
0
        public void When_Parameter_Name_Is_Empty_Uses_Order_To_Find_Topic()
        {
            var from  = "0xc14934679e71ef4d18b6ae927fe2b953c7fd9b91";
            var to    = "0xc14934679e71ef4d18b6ae927fe2b953c7fd9b92";
            var value = BigInteger.One;

            var filter = new NewFilterInputBuilder <TransferEvent_WithEmptyParameterNames>()
                         .AddTopic(template => template.From, from)
                         .AddTopic(template => template.To, to)
                         .AddTopic(template => template.Value, value)
                         .Build();

            Assert.Equal("0x000000000000000000000000c14934679e71ef4d18b6ae927fe2b953c7fd9b91",
                         filter.GetFirstTopicValueAsString(1));

            Assert.Equal("0x000000000000000000000000c14934679e71ef4d18b6ae927fe2b953c7fd9b92",
                         filter.GetFirstTopicValueAsString(2));

            Assert.Equal("0x0000000000000000000000000000000000000000000000000000000000000001",
                         filter.GetFirstTopicValueAsString(3));
        }
Ejemplo n.º 2
0
        public void Can_Assign_To_Multiple_Topics()
        {
            var from  = "0xc14934679e71ef4d18b6ae927fe2b953c7fd9b91";
            var to    = "0xc14934679e71ef4d18b6ae927fe2b953c7fd9b92";
            var value = BigInteger.One;

            var filter = new NewFilterInputBuilder <TransferEvent>()
                         .AddTopic(template => template.From, from)
                         .AddTopic(template => template.To, to)
                         .AddTopic(template => template.Value, value)
                         .Build();

            Assert.Equal("0x000000000000000000000000c14934679e71ef4d18b6ae927fe2b953c7fd9b91",
                         filter.GetFirstTopicValueAsString(1));

            Assert.Equal("0x000000000000000000000000c14934679e71ef4d18b6ae927fe2b953c7fd9b92",
                         filter.GetFirstTopicValueAsString(2));

            Assert.Equal("0x0000000000000000000000000000000000000000000000000000000000000001",
                         filter.GetFirstTopicValueAsString(3));
        }
Ejemplo n.º 3
0
        public void Can_Assign_To_Topic3()
        {
            var value = BigInteger.One;

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

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

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

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