diff --git a/pkg/loop/internal/pb/chain_reader.pb.go b/pkg/loop/internal/pb/chain_reader.pb.go index 4f7b84491..4f56656da 100644 --- a/pkg/loop/internal/pb/chain_reader.pb.go +++ b/pkg/loop/internal/pb/chain_reader.pb.go @@ -1500,7 +1500,7 @@ type Block struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BlockNumber uint64 `protobuf:"varint,1,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + BlockNumber string `protobuf:"bytes,1,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` Operator ComparisonOperator `protobuf:"varint,2,opt,name=operator,proto3,enum=loop.ComparisonOperator" json:"operator,omitempty"` } @@ -1536,11 +1536,11 @@ func (*Block) Descriptor() ([]byte, []int) { return file_chain_reader_proto_rawDescGZIP(), []int{21} } -func (x *Block) GetBlockNumber() uint64 { +func (x *Block) GetBlockNumber() string { if x != nil { return x.BlockNumber } - return 0 + return "" } func (x *Block) GetOperator() ComparisonOperator { @@ -2101,7 +2101,7 @@ var file_chain_reader_proto_rawDesc = []byte{ 0x72, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x60, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x28, 0x09, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x6f, 0x70, 0x65, diff --git a/pkg/loop/internal/pb/chain_reader.proto b/pkg/loop/internal/pb/chain_reader.proto index 2c61141e8..c84e12620 100644 --- a/pkg/loop/internal/pb/chain_reader.proto +++ b/pkg/loop/internal/pb/chain_reader.proto @@ -151,7 +151,7 @@ message Comparator { } message Block{ - uint64 block_number = 1; + string block_number = 1; ComparisonOperator operator = 2; } diff --git a/pkg/loop/internal/relayer/pluginprovider/chainreader/helper_test.go b/pkg/loop/internal/relayer/pluginprovider/chainreader/helper_test.go index 6928e0e50..a38b87eb0 100644 --- a/pkg/loop/internal/relayer/pluginprovider/chainreader/helper_test.go +++ b/pkg/loop/internal/relayer/pluginprovider/chainreader/helper_test.go @@ -106,7 +106,7 @@ func generateQueryFilterTestCases(t *testing.T) []query.KeyFilter { primitiveExpressions := []query.Expression{query.TxHash("txHash")} for _, op := range operatorValues { - primitiveExpressions = append(primitiveExpressions, query.Block(123, op)) + primitiveExpressions = append(primitiveExpressions, query.Block("123", op)) primitiveExpressions = append(primitiveExpressions, query.Timestamp(123, op)) var valueComparators []primitives.ValueComparator diff --git a/pkg/types/query/primitives/primitives.go b/pkg/types/query/primitives/primitives.go index c18b608c5..34d26d352 100644 --- a/pkg/types/query/primitives/primitives.go +++ b/pkg/types/query/primitives/primitives.go @@ -42,7 +42,7 @@ func (f *Comparator) Accept(visitor Visitor) { // Block is a primitive of KeyFilter that filters search in comparison to block number. type Block struct { - Block uint64 + Block string Operator ComparisonOperator } diff --git a/pkg/types/query/query.go b/pkg/types/query/query.go index 1246a0bd7..129af6760 100644 --- a/pkg/types/query/query.go +++ b/pkg/types/query/query.go @@ -57,7 +57,7 @@ func Comparator(name string, valueComparators ...primitives.ValueComparator) Exp return Expression{Primitive: &primitives.Comparator{Name: name, ValueComparators: valueComparators}} } -func Block(block uint64, operator primitives.ComparisonOperator) Expression { +func Block(block string, operator primitives.ComparisonOperator) Expression { return Expression{ Primitive: &primitives.Block{Block: block, Operator: operator}, } diff --git a/pkg/types/query/query_test.go b/pkg/types/query/query_test.go index 7773c36a5..3ed3e4f1b 100644 --- a/pkg/types/query/query_test.go +++ b/pkg/types/query/query_test.go @@ -39,20 +39,20 @@ func Test_AndOrEdgeCases(t *testing.T) { }, { name: "And with multiple expressions", - expressions: []Expression{TxHash("txHash"), Block(123, primitives.Eq)}, + expressions: []Expression{TxHash("txHash"), Block("123", primitives.Eq)}, constructor: And, expected: And( TxHash("txHash"), - Block(123, primitives.Eq), + Block("123", primitives.Eq), ), }, { name: "Or with multiple expressions", - expressions: []Expression{TxHash("txHash"), Block(123, primitives.Eq)}, + expressions: []Expression{TxHash("txHash"), Block("123", primitives.Eq)}, constructor: Or, expected: Or( TxHash("txHash"), - Block(123, primitives.Eq), + Block("123", primitives.Eq), ), }, }