diff --git a/proto/evm/query.proto b/proto/evm/query.proto index f92d02df0..33888c4aa 100644 --- a/proto/evm/query.proto +++ b/proto/evm/query.proto @@ -27,6 +27,10 @@ service Query { rpc PointerVersion(QueryPointerVersionRequest) returns (QueryPointerVersionResponse) { option (google.api.http).get = "/sei-protocol/seichain/evm/pointer_version"; } + + rpc Pointee(QueryPointeeRequest) returns (QueryPointeeResponse) { + option (google.api.http).get = "/sei-protocol/seichain/evm/pointee"; + } } message QuerySeiAddressByEVMAddressRequest { @@ -75,3 +79,14 @@ message QueryPointerVersionResponse { uint32 version = 1; uint64 cw_code_id = 2; } + +message QueryPointeeRequest { + PointerType pointer_type = 1; + string pointer = 2; +} + +message QueryPointeeResponse { + string pointee = 1; + uint32 version = 2; + bool exists = 3; +} \ No newline at end of file diff --git a/x/evm/client/cli/query.go b/x/evm/client/cli/query.go index ad8806f81..091e0e4af 100644 --- a/x/evm/client/cli/query.go +++ b/x/evm/client/cli/query.go @@ -44,6 +44,7 @@ func GetQueryCmd(_ string) *cobra.Command { cmd.AddCommand(CmdQueryPayload()) cmd.AddCommand(CmdQueryPointer()) cmd.AddCommand(CmdQueryPointerVersion()) + cmd.AddCommand(CmdQueryPointee()) return cmd } @@ -348,3 +349,32 @@ func CmdQueryPointerVersion() *cobra.Command { return cmd } + +func CmdQueryPointee() *cobra.Command { + cmd := &cobra.Command{ + Use: "pointee [type] [pointer]", + Short: "Get pointee address of the specified type (one of [NATIVE, CW20, CW721, ERC20, ERC721]) and pointer", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + ctx := cmd.Context() + + res, err := queryClient.Pointee(ctx, &types.QueryPointeeRequest{ + PointerType: types.PointerType(types.PointerType_value[args[0]]), Pointer: args[1], + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/evm/keeper/grpc_query.go b/x/evm/keeper/grpc_query.go index 095f2c3c1..16bd0b000 100644 --- a/x/evm/keeper/grpc_query.go +++ b/x/evm/keeper/grpc_query.go @@ -146,3 +146,46 @@ func (q Querier) PointerVersion(c context.Context, req *types.QueryPointerVersio return nil, errors.ErrUnsupported } } + +func (q Querier) Pointee(c context.Context, req *types.QueryPointeeRequest) (*types.QueryPointeeResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + switch req.PointerType { + case types.PointerType_NATIVE: + p, v, e := q.Keeper.GetNativePointee(ctx, req.Pointer) + return &types.QueryPointeeResponse{ + Pointee: p, + Version: uint32(v), + Exists: e, + }, nil + case types.PointerType_CW20: + p, v, e := q.Keeper.GetCW20Pointee(ctx, common.HexToAddress(req.Pointer)) + return &types.QueryPointeeResponse{ + Pointee: p, + Version: uint32(v), + Exists: e, + }, nil + case types.PointerType_CW721: + p, v, e := q.Keeper.GetCW721Pointee(ctx, common.HexToAddress(req.Pointer)) + return &types.QueryPointeeResponse{ + Pointee: p, + Version: uint32(v), + Exists: e, + }, nil + case types.PointerType_ERC20: + p, v, e := q.Keeper.GetERC20Pointee(ctx, req.Pointer) + return &types.QueryPointeeResponse{ + Pointee: p.Hex(), + Version: uint32(v), + Exists: e, + }, nil + case types.PointerType_ERC721: + p, v, e := q.Keeper.GetERC721Pointee(ctx, req.Pointer) + return &types.QueryPointeeResponse{ + Pointee: p.Hex(), + Version: uint32(v), + Exists: e, + }, nil + default: + return nil, errors.ErrUnsupported + } +} diff --git a/x/evm/keeper/grpc_query_test.go b/x/evm/keeper/grpc_query_test.go index e8b08a267..11d57b1c8 100644 --- a/x/evm/keeper/grpc_query_test.go +++ b/x/evm/keeper/grpc_query_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "errors" "testing" "time" @@ -47,3 +48,118 @@ func TestQueryPointer(t *testing.T) { require.Nil(t, err) require.Equal(t, types.QueryPointerResponse{Pointer: seiAddr5.String(), Version: uint32(erc721.CurrentVersion), Exists: true}, *res) } + +func TestQueryPointee(t *testing.T) { + k, ctx := testkeeper.MockEVMKeeper() + _, pointerAddr1 := testkeeper.MockAddressPair() + seiAddr2, evmAddr2 := testkeeper.MockAddressPair() + seiAddr3, evmAddr3 := testkeeper.MockAddressPair() + seiAddr4, evmAddr4 := testkeeper.MockAddressPair() + seiAddr5, evmAddr5 := testkeeper.MockAddressPair() + goCtx := sdk.WrapSDKContext(ctx) + + // Set up pointers for each type + k.SetERC20NativePointer(ctx, "ufoo", pointerAddr1) + k.SetERC20CW20Pointer(ctx, seiAddr2.String(), evmAddr2) + k.SetERC721CW721Pointer(ctx, seiAddr3.String(), evmAddr3) + k.SetCW20ERC20Pointer(ctx, evmAddr4, seiAddr4.String()) + k.SetCW721ERC721Pointer(ctx, evmAddr5, seiAddr5.String()) + + q := keeper.Querier{k} + + // Test for Native Pointee + res, err := q.Pointee(goCtx, &types.QueryPointeeRequest{PointerType: types.PointerType_NATIVE, Pointer: pointerAddr1.Hex()}) + require.Nil(t, err) + require.Equal(t, types.QueryPointeeResponse{Pointee: "ufoo", Version: uint32(native.CurrentVersion), Exists: true}, *res) + + // Test for CW20 Pointee + res, err = q.Pointee(goCtx, &types.QueryPointeeRequest{PointerType: types.PointerType_CW20, Pointer: evmAddr2.Hex()}) + require.Nil(t, err) + require.Equal(t, types.QueryPointeeResponse{Pointee: seiAddr2.String(), Version: uint32(cw20.CurrentVersion(ctx)), Exists: true}, *res) + + // Test for CW721 Pointee + res, err = q.Pointee(goCtx, &types.QueryPointeeRequest{PointerType: types.PointerType_CW721, Pointer: evmAddr3.Hex()}) + require.Nil(t, err) + require.Equal(t, types.QueryPointeeResponse{Pointee: seiAddr3.String(), Version: uint32(cw721.CurrentVersion), Exists: true}, *res) + + // Test for ERC20 Pointee + res, err = q.Pointee(goCtx, &types.QueryPointeeRequest{PointerType: types.PointerType_ERC20, Pointer: seiAddr4.String()}) + require.Nil(t, err) + require.Equal(t, types.QueryPointeeResponse{Pointee: evmAddr4.Hex(), Version: uint32(erc20.CurrentVersion), Exists: true}, *res) + + // Test for ERC721 Pointee + res, err = q.Pointee(goCtx, &types.QueryPointeeRequest{PointerType: types.PointerType_ERC721, Pointer: seiAddr5.String()}) + require.Nil(t, err) + require.Equal(t, types.QueryPointeeResponse{Pointee: evmAddr5.Hex(), Version: uint32(erc721.CurrentVersion), Exists: true}, *res) + + // Test for not registered Native Pointee + res, err = q.Pointee(goCtx, &types.QueryPointeeRequest{PointerType: types.PointerType_NATIVE, Pointer: "0x1234567890123456789012345678901234567890"}) + require.Nil(t, err) + require.Equal(t, types.QueryPointeeResponse{Pointee: "", Version: 0, Exists: false}, *res) + + // Test for not registered CW20 Pointee + res, err = q.Pointee(goCtx, &types.QueryPointeeRequest{PointerType: types.PointerType_CW20, Pointer: "0x1234567890123456789012345678901234567890"}) + require.Nil(t, err) + require.Equal(t, types.QueryPointeeResponse{Pointee: "", Version: 0, Exists: false}, *res) + + // Test for not registered CW721 Pointee + res, err = q.Pointee(goCtx, &types.QueryPointeeRequest{PointerType: types.PointerType_CW721, Pointer: "0x1234567890123456789012345678901234567890"}) + require.Nil(t, err) + require.Equal(t, types.QueryPointeeResponse{Pointee: "", Version: 0, Exists: false}, *res) + + // Test for not registered ERC20 Pointee + res, err = q.Pointee(goCtx, &types.QueryPointeeRequest{PointerType: types.PointerType_ERC20, Pointer: "sei1notregistered"}) + require.Nil(t, err) + require.Equal(t, types.QueryPointeeResponse{Pointee: "0x0000000000000000000000000000000000000000", Version: 0, Exists: false}, *res) + + // Test for not registered ERC721 Pointee + res, err = q.Pointee(goCtx, &types.QueryPointeeRequest{PointerType: types.PointerType_ERC721, Pointer: "sei1notregistered"}) + require.Nil(t, err) + require.Equal(t, types.QueryPointeeResponse{Pointee: "0x0000000000000000000000000000000000000000", Version: 0, Exists: false}, *res) + + // Test cases for invalid inputs + testCases := []struct { + name string + req *types.QueryPointeeRequest + expectedRes *types.QueryPointeeResponse + expectedErr error + }{ + { + name: "Invalid pointer type", + req: &types.QueryPointeeRequest{PointerType: 999, Pointer: pointerAddr1.Hex()}, + expectedRes: nil, + expectedErr: errors.ErrUnsupported, + }, + { + name: "Empty pointer", + req: &types.QueryPointeeRequest{PointerType: types.PointerType_NATIVE, Pointer: ""}, + expectedRes: &types.QueryPointeeResponse{Pointee: "", Version: 0, Exists: false}, + expectedErr: nil, + }, + { + name: "Invalid hex address for EVM-based pointer types", + req: &types.QueryPointeeRequest{PointerType: types.PointerType_CW20, Pointer: "not-a-hex-address"}, + expectedRes: &types.QueryPointeeResponse{Pointee: "", Version: 0, Exists: false}, + expectedErr: nil, + }, + { + name: "Invalid bech32 address for Cosmos-based pointer types", + req: &types.QueryPointeeRequest{PointerType: types.PointerType_ERC20, Pointer: "not-a-bech32-address"}, + expectedRes: &types.QueryPointeeResponse{Pointee: "0x0000000000000000000000000000000000000000", Version: 0, Exists: false}, + expectedErr: nil, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + res, err := q.Pointee(goCtx, tc.req) + if tc.expectedErr != nil { + require.ErrorIs(t, err, tc.expectedErr) + require.Nil(t, res) + } else { + require.NoError(t, err) + require.Equal(t, tc.expectedRes, res) + } + }) + } +} diff --git a/x/evm/keeper/pointer.go b/x/evm/keeper/pointer.go index 8c80c64a8..467cd8861 100644 --- a/x/evm/keeper/pointer.go +++ b/x/evm/keeper/pointer.go @@ -254,3 +254,45 @@ func (k *Keeper) GetStoredPointerCodeID(ctx sdk.Context, pointerType types.Point } return binary.BigEndian.Uint64(bz) } + +func (k *Keeper) GetCW20Pointee(ctx sdk.Context, erc20Address common.Address) (cw20Address string, version uint16, exists bool) { + addrBz, version, exists := k.GetPointerInfo(ctx, types.PointerReverseRegistryKey(erc20Address)) + if exists { + cw20Address = string(addrBz) + } + return +} + +func (k *Keeper) GetCW721Pointee(ctx sdk.Context, erc721Address common.Address) (cw721Address string, version uint16, exists bool) { + addrBz, version, exists := k.GetPointerInfo(ctx, types.PointerReverseRegistryKey(erc721Address)) + if exists { + cw721Address = string(addrBz) + } + return +} + +func (k *Keeper) GetERC20Pointee(ctx sdk.Context, cw20Address string) (erc20Address common.Address, version uint16, exists bool) { + addrBz, version, exists := k.GetPointerInfo(ctx, types.PointerReverseRegistryKey(common.BytesToAddress([]byte(cw20Address)))) + if exists { + erc20Address = common.BytesToAddress(addrBz) + } + return +} + +func (k *Keeper) GetERC721Pointee(ctx sdk.Context, cw721Address string) (erc721Address common.Address, version uint16, exists bool) { + addrBz, version, exists := k.GetPointerInfo(ctx, types.PointerReverseRegistryKey(common.BytesToAddress([]byte(cw721Address)))) + if exists { + erc721Address = common.BytesToAddress(addrBz) + } + return +} + +func (k *Keeper) GetNativePointee(ctx sdk.Context, erc20Address string) (token string, version uint16, exists bool) { + // Ensure the key matches how it was set in SetERC20NativePointer + key := types.PointerReverseRegistryKey(common.HexToAddress(erc20Address)) + addrBz, version, exists := k.GetPointerInfo(ctx, key) + if exists { + token = string(addrBz) + } + return +} diff --git a/x/evm/types/query.pb.go b/x/evm/types/query.pb.go index a13d53789..138f54fed 100644 --- a/x/evm/types/query.pb.go +++ b/x/evm/types/query.pb.go @@ -524,6 +524,118 @@ func (m *QueryPointerVersionResponse) GetCwCodeId() uint64 { return 0 } +type QueryPointeeRequest struct { + PointerType PointerType `protobuf:"varint,1,opt,name=pointer_type,json=pointerType,proto3,enum=seiprotocol.seichain.evm.PointerType" json:"pointer_type,omitempty"` + Pointer string `protobuf:"bytes,2,opt,name=pointer,proto3" json:"pointer,omitempty"` +} + +func (m *QueryPointeeRequest) Reset() { *m = QueryPointeeRequest{} } +func (m *QueryPointeeRequest) String() string { return proto.CompactTextString(m) } +func (*QueryPointeeRequest) ProtoMessage() {} +func (*QueryPointeeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_11c0d37eed5339f7, []int{10} +} +func (m *QueryPointeeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPointeeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPointeeRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryPointeeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPointeeRequest.Merge(m, src) +} +func (m *QueryPointeeRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryPointeeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPointeeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPointeeRequest proto.InternalMessageInfo + +func (m *QueryPointeeRequest) GetPointerType() PointerType { + if m != nil { + return m.PointerType + } + return PointerType_ERC20 +} + +func (m *QueryPointeeRequest) GetPointer() string { + if m != nil { + return m.Pointer + } + return "" +} + +type QueryPointeeResponse struct { + Pointee string `protobuf:"bytes,1,opt,name=pointee,proto3" json:"pointee,omitempty"` + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + Exists bool `protobuf:"varint,3,opt,name=exists,proto3" json:"exists,omitempty"` +} + +func (m *QueryPointeeResponse) Reset() { *m = QueryPointeeResponse{} } +func (m *QueryPointeeResponse) String() string { return proto.CompactTextString(m) } +func (*QueryPointeeResponse) ProtoMessage() {} +func (*QueryPointeeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_11c0d37eed5339f7, []int{11} +} +func (m *QueryPointeeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPointeeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPointeeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryPointeeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPointeeResponse.Merge(m, src) +} +func (m *QueryPointeeResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryPointeeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPointeeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPointeeResponse proto.InternalMessageInfo + +func (m *QueryPointeeResponse) GetPointee() string { + if m != nil { + return m.Pointee + } + return "" +} + +func (m *QueryPointeeResponse) GetVersion() uint32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *QueryPointeeResponse) GetExists() bool { + if m != nil { + return m.Exists + } + return false +} + func init() { proto.RegisterType((*QuerySeiAddressByEVMAddressRequest)(nil), "seiprotocol.seichain.evm.QuerySeiAddressByEVMAddressRequest") proto.RegisterType((*QuerySeiAddressByEVMAddressResponse)(nil), "seiprotocol.seichain.evm.QuerySeiAddressByEVMAddressResponse") @@ -535,52 +647,56 @@ func init() { proto.RegisterType((*QueryPointerResponse)(nil), "seiprotocol.seichain.evm.QueryPointerResponse") proto.RegisterType((*QueryPointerVersionRequest)(nil), "seiprotocol.seichain.evm.QueryPointerVersionRequest") proto.RegisterType((*QueryPointerVersionResponse)(nil), "seiprotocol.seichain.evm.QueryPointerVersionResponse") + proto.RegisterType((*QueryPointeeRequest)(nil), "seiprotocol.seichain.evm.QueryPointeeRequest") + proto.RegisterType((*QueryPointeeResponse)(nil), "seiprotocol.seichain.evm.QueryPointeeResponse") } func init() { proto.RegisterFile("evm/query.proto", fileDescriptor_11c0d37eed5339f7) } var fileDescriptor_11c0d37eed5339f7 = []byte{ - // 627 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcd, 0x6e, 0xd3, 0x4e, - 0x14, 0xc5, 0xeb, 0xfc, 0xfb, 0xef, 0xc7, 0x6d, 0x29, 0xd2, 0x80, 0x4a, 0x64, 0x2a, 0x53, 0x99, - 0x0f, 0x55, 0x15, 0xb1, 0xa1, 0xc0, 0xae, 0x2c, 0x68, 0x55, 0x01, 0x0b, 0x24, 0x30, 0xd0, 0x05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x7c, 0x16, 0x5e, 0xf0, 0x6b, 0x64, 0x86, 0x27, 0xd2, 0x32, 0xfd, 0xc2, 0xf0, - 0xbd, 0x19, 0xf9, 0xfb, 0x83, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xbe, 0x8f, 0x9b, 0x9d, - 0x07, 0x00, 0x00, + // 662 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xcf, 0x6e, 0xd3, 0x4e, + 0x10, 0xae, 0xf3, 0xeb, 0xaf, 0x7f, 0xa6, 0xa5, 0x48, 0x0b, 0x2a, 0x91, 0xa9, 0x4c, 0x65, 0xfe, + 0xa8, 0xaa, 0x88, 0x03, 0x05, 0x6e, 0xe5, 0x40, 0xab, 0x0a, 0x38, 0x20, 0x81, 0x81, 0x1e, 0xb8, + 0x44, 0xae, 0x3d, 0x6d, 0x57, 0x8a, 0xbd, 0xae, 0x77, 0x93, 0x36, 0x57, 0x9e, 0x00, 0x09, 0xae, + 0x1c, 0x78, 0x04, 0x1e, 0x02, 0x89, 0x63, 0x25, 0x2e, 0x1c, 0x51, 0xcb, 0x83, 0x20, 0xaf, 0xd7, + 0xb1, 0x9d, 0xa6, 0x76, 0x52, 0xc1, 0x6d, 0x67, 0x3d, 0xdf, 0x37, 0xdf, 0xcc, 0xac, 0x3f, 0xb8, + 0x8c, 0x5d, 0xbf, 0x79, 0xd0, 0xc1, 0xa8, 0x67, 0x85, 0x11, 0x13, 0x8c, 0xd4, 0x39, 0x52, 0x79, + 0x72, 0x59, 0xdb, 0xe2, 0x48, 0xdd, 0x7d, 0x87, 0x06, 0x16, 0x76, 0x7d, 0x7d, 0x69, 0x8f, 0xb1, + 0xbd, 0x36, 0x36, 0x9d, 0x90, 0x36, 0x9d, 0x20, 0x60, 0xc2, 0x11, 0x94, 0x05, 0x3c, 0xc1, 0xe9, + 0x92, 0x08, 0x83, 0x8e, 0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0x08, 0xb9, 0x57, 0x35, 0xc5, 0x41, 0xab, 0xd2, 0xef, 0x8f, 0x81, 0x18, 0x67, 0xd6, 0x12, 0xd6, + 0x72, 0x63, 0x51, 0x9f, 0x34, 0x98, 0x56, 0x0f, 0x9b, 0x34, 0x2a, 0xca, 0x15, 0xed, 0x4d, 0xb7, + 0x46, 0x4d, 0x57, 0xd2, 0x56, 0xa5, 0xb4, 0x5b, 0xc4, 0x2c, 0x91, 0x96, 0x9a, 0xd4, 0x57, 0x0d, + 0x16, 0x8a, 0x36, 0x40, 0x1e, 0x8e, 0x56, 0xae, 0xe8, 0x4e, 0xfa, 0xa3, 0x31, 0x51, 0x4a, 0xeb, + 0x9a, 0xd4, 0x7a, 0x97, 0xac, 0x56, 0x6b, 0x6d, 0xa5, 0x3f, 0x68, 0x36, 0x4a, 0x1c, 0x71, 0x94, + 0x38, 0xde, 0x28, 0xf1, 0x02, 0xa3, 0xc4, 0x8d, 0xa7, 0xdf, 0x4f, 0x0c, 0xed, 0xf8, 0xc4, 0xd0, + 0x7e, 0x9d, 0x18, 0xda, 0x87, 0x53, 0x63, 0xe2, 0xf8, 0xd4, 0x98, 0xf8, 0x79, 0x6a, 0x4c, 0xbc, + 0x6b, 0xec, 0x51, 0xb1, 0xdf, 0xd9, 0xb1, 0x5c, 0xe6, 0x9f, 0xe1, 0x69, 0x24, 0x44, 0x47, 0x92, + 0x2a, 0xf6, 0x47, 0xbe, 0x33, 0x25, 0xbf, 0x3f, 0xf8, 0x13, 0x00, 0x00, 0xff, 0xff, 0x2b, 0xa9, + 0x46, 0xf3, 0x13, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -600,6 +716,7 @@ type QueryClient interface { StaticCall(ctx context.Context, in *QueryStaticCallRequest, opts ...grpc.CallOption) (*QueryStaticCallResponse, error) Pointer(ctx context.Context, in *QueryPointerRequest, opts ...grpc.CallOption) (*QueryPointerResponse, error) PointerVersion(ctx context.Context, in *QueryPointerVersionRequest, opts ...grpc.CallOption) (*QueryPointerVersionResponse, error) + Pointee(ctx context.Context, in *QueryPointeeRequest, opts ...grpc.CallOption) (*QueryPointeeResponse, error) } type queryClient struct { @@ -655,6 +772,15 @@ func (c *queryClient) PointerVersion(ctx context.Context, in *QueryPointerVersio return out, nil } +func (c *queryClient) Pointee(ctx context.Context, in *QueryPointeeRequest, opts ...grpc.CallOption) (*QueryPointeeResponse, error) { + out := new(QueryPointeeResponse) + err := c.cc.Invoke(ctx, "/seiprotocol.seichain.evm.Query/Pointee", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { SeiAddressByEVMAddress(context.Context, *QuerySeiAddressByEVMAddressRequest) (*QuerySeiAddressByEVMAddressResponse, error) @@ -662,6 +788,7 @@ type QueryServer interface { StaticCall(context.Context, *QueryStaticCallRequest) (*QueryStaticCallResponse, error) Pointer(context.Context, *QueryPointerRequest) (*QueryPointerResponse, error) PointerVersion(context.Context, *QueryPointerVersionRequest) (*QueryPointerVersionResponse, error) + Pointee(context.Context, *QueryPointeeRequest) (*QueryPointeeResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -683,6 +810,9 @@ func (*UnimplementedQueryServer) Pointer(ctx context.Context, req *QueryPointerR func (*UnimplementedQueryServer) PointerVersion(ctx context.Context, req *QueryPointerVersionRequest) (*QueryPointerVersionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PointerVersion not implemented") } +func (*UnimplementedQueryServer) Pointee(ctx context.Context, req *QueryPointeeRequest) (*QueryPointeeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Pointee not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -778,6 +908,24 @@ func _Query_PointerVersion_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Query_Pointee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPointeeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Pointee(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/seiprotocol.seichain.evm.Query/Pointee", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Pointee(ctx, req.(*QueryPointeeRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "seiprotocol.seichain.evm.Query", HandlerType: (*QueryServer)(nil), @@ -802,6 +950,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "PointerVersion", Handler: _Query_PointerVersion_Handler, }, + { + MethodName: "Pointee", + Handler: _Query_Pointee_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "evm/query.proto", @@ -1155,6 +1307,86 @@ func (m *QueryPointerVersionResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } +func (m *QueryPointeeRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryPointeeRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPointeeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Pointer) > 0 { + i -= len(m.Pointer) + copy(dAtA[i:], m.Pointer) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Pointer))) + i-- + dAtA[i] = 0x12 + } + if m.PointerType != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.PointerType)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryPointeeResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryPointeeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPointeeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Exists { + i-- + if m.Exists { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.Version != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x10 + } + if len(m.Pointee) > 0 { + i -= len(m.Pointee) + copy(dAtA[i:], m.Pointee) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Pointee))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1316,6 +1548,41 @@ func (m *QueryPointerVersionResponse) Size() (n int) { return n } +func (m *QueryPointeeRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PointerType != 0 { + n += 1 + sovQuery(uint64(m.PointerType)) + } + l = len(m.Pointer) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryPointeeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Pointee) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Version != 0 { + n += 1 + sovQuery(uint64(m.Version)) + } + if m.Exists { + n += 2 + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2269,6 +2536,228 @@ func (m *QueryPointerVersionResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryPointeeRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryPointeeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPointeeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PointerType", wireType) + } + m.PointerType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PointerType |= PointerType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pointer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pointer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryPointeeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryPointeeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPointeeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pointee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pointee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exists", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Exists = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/evm/types/query.pb.gw.go b/x/evm/types/query.pb.gw.go index 72c5e53f0..21a2750cb 100644 --- a/x/evm/types/query.pb.gw.go +++ b/x/evm/types/query.pb.gw.go @@ -213,6 +213,42 @@ func local_request_Query_PointerVersion_0(ctx context.Context, marshaler runtime } +var ( + filter_Query_Pointee_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Pointee_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPointeeRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Pointee_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Pointee(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Pointee_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPointeeRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Pointee_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Pointee(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -334,6 +370,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Pointee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Pointee_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Pointee_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -475,6 +534,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Pointee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Pointee_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Pointee_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -488,6 +567,8 @@ var ( pattern_Query_Pointer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sei-protocol", "seichain", "evm", "pointer"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_PointerVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sei-protocol", "seichain", "evm", "pointer_version"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Pointee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sei-protocol", "seichain", "evm", "pointee"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -500,4 +581,6 @@ var ( forward_Query_Pointer_0 = runtime.ForwardResponseMessage forward_Query_PointerVersion_0 = runtime.ForwardResponseMessage + + forward_Query_Pointee_0 = runtime.ForwardResponseMessage )