From 8e58a302ebb22edcd4af07c78a57423e8aad3f89 Mon Sep 17 00:00:00 2001 From: Jeremy Liu <31809888+NotJeremyLiu@users.noreply.github.com> Date: Sat, 9 Dec 2023 20:28:13 -0700 Subject: [PATCH 01/10] add and generate build address query protos --- docs/proto/proto-docs.md | 38 ++ proto/cosmwasm/wasm/v1/query.proto | 27 + x/wasm/types/query.pb.go | 767 +++++++++++++++++++++++++---- x/wasm/types/query.pb.gw.go | 77 +++ 4 files changed, 821 insertions(+), 88 deletions(-) diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index c3de180ca7..7ee59b02c0 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -60,6 +60,8 @@ - [CodeInfoResponse](#cosmwasm.wasm.v1.CodeInfoResponse) - [QueryAllContractStateRequest](#cosmwasm.wasm.v1.QueryAllContractStateRequest) - [QueryAllContractStateResponse](#cosmwasm.wasm.v1.QueryAllContractStateResponse) + - [QueryBuildAddressRequest](#cosmwasm.wasm.v1.QueryBuildAddressRequest) + - [QueryBuildAddressResponse](#cosmwasm.wasm.v1.QueryBuildAddressResponse) - [QueryCodeRequest](#cosmwasm.wasm.v1.QueryCodeRequest) - [QueryCodeResponse](#cosmwasm.wasm.v1.QueryCodeResponse) - [QueryCodesRequest](#cosmwasm.wasm.v1.QueryCodesRequest) @@ -1018,6 +1020,41 @@ Query/AllContractState RPC method + + +### QueryBuildAddressRequest +QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `code_hash` | [string](#string) | | CodeHash is the hash of the code | +| `creator_address` | [string](#string) | | CreatorAddress is the address of the contract instantiator | +| `salt` | [string](#string) | | Salt is a hex encoded salt | +| `init_args` | [bytes](#bytes) | optional | InitArgs are the json encoded init args to be used in contract address building if provided | + + + + + + + + +### QueryBuildAddressResponse +QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `address` | [string](#string) | | Address is the contract address | + + + + + + ### QueryCodeRequest @@ -1363,6 +1400,7 @@ Query provides defines the gRPC querier service | `PinnedCodes` | [QueryPinnedCodesRequest](#cosmwasm.wasm.v1.QueryPinnedCodesRequest) | [QueryPinnedCodesResponse](#cosmwasm.wasm.v1.QueryPinnedCodesResponse) | PinnedCodes gets the pinned code ids | GET|/cosmwasm/wasm/v1/codes/pinned| | `Params` | [QueryParamsRequest](#cosmwasm.wasm.v1.QueryParamsRequest) | [QueryParamsResponse](#cosmwasm.wasm.v1.QueryParamsResponse) | Params gets the module params | GET|/cosmwasm/wasm/v1/codes/params| | `ContractsByCreator` | [QueryContractsByCreatorRequest](#cosmwasm.wasm.v1.QueryContractsByCreatorRequest) | [QueryContractsByCreatorResponse](#cosmwasm.wasm.v1.QueryContractsByCreatorResponse) | ContractsByCreator gets the contracts by creator | GET|/cosmwasm/wasm/v1/contracts/creator/{creator_address}| +| `BuildAddress` | [QueryBuildAddressRequest](#cosmwasm.wasm.v1.QueryBuildAddressRequest) | [QueryBuildAddressResponse](#cosmwasm.wasm.v1.QueryBuildAddressResponse) | BuildAddress builds a contract address | GET|/cosmwasm/wasm/v1/contract/build_address| diff --git a/proto/cosmwasm/wasm/v1/query.proto b/proto/cosmwasm/wasm/v1/query.proto index 16840585a3..cca692da33 100644 --- a/proto/cosmwasm/wasm/v1/query.proto +++ b/proto/cosmwasm/wasm/v1/query.proto @@ -72,6 +72,12 @@ service Query { option (google.api.http).get = "/cosmwasm/wasm/v1/contracts/creator/{creator_address}"; } + + // BuildAddress builds a contract address + rpc BuildAddress(QueryBuildAddressRequest) + returns (QueryBuildAddressResponse) { + option (google.api.http).get = "/cosmwasm/wasm/v1/contract/build_address"; + } } // QueryContractInfoRequest is the request type for the Query/ContractInfo RPC @@ -268,4 +274,25 @@ message QueryContractsByCreatorResponse { [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC +// method. +message QueryBuildAddressRequest { + // CodeHash is the hash of the code + string code_hash = 1; + // CreatorAddress is the address of the contract instantiator + string creator_address = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Salt is a hex encoded salt + string salt = 3; + // InitArgs are the json encoded init args to be used in contract address + // building if provided + optional bytes init_args = 4; +} + +// QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC +// method. +message QueryBuildAddressResponse { + // Address is the contract address + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; } \ No newline at end of file diff --git a/x/wasm/types/query.pb.go b/x/wasm/types/query.pb.go index b8874bfbba..afd5ff5af7 100644 --- a/x/wasm/types/query.pb.go +++ b/x/wasm/types/query.pb.go @@ -1082,6 +1082,136 @@ func (m *QueryContractsByCreatorResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryContractsByCreatorResponse proto.InternalMessageInfo +// QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC +// method. +type QueryBuildAddressRequest struct { + // CodeHash is the hash of the code + CodeHash string `protobuf:"bytes,1,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty"` + // CreatorAddress is the address of the contract instantiator + CreatorAddress string `protobuf:"bytes,2,opt,name=creator_address,json=creatorAddress,proto3" json:"creator_address,omitempty"` + // Salt is a hex encoded salt + Salt string `protobuf:"bytes,3,opt,name=salt,proto3" json:"salt,omitempty"` + // Types that are valid to be assigned to XInitArgs: + // *QueryBuildAddressRequest_InitArgs + XInitArgs isQueryBuildAddressRequest_XInitArgs `protobuf_oneof:"_init_args"` +} + +func (m *QueryBuildAddressRequest) Reset() { *m = QueryBuildAddressRequest{} } +func (m *QueryBuildAddressRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBuildAddressRequest) ProtoMessage() {} +func (*QueryBuildAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9677c207036b9f2b, []int{23} +} + +func (m *QueryBuildAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *QueryBuildAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBuildAddressRequest.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 *QueryBuildAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBuildAddressRequest.Merge(m, src) +} + +func (m *QueryBuildAddressRequest) XXX_Size() int { + return m.Size() +} + +func (m *QueryBuildAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBuildAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBuildAddressRequest proto.InternalMessageInfo + +type isQueryBuildAddressRequest_XInitArgs interface { + isQueryBuildAddressRequest_XInitArgs() + MarshalTo([]byte) (int, error) + Size() int +} + +type QueryBuildAddressRequest_InitArgs struct { + InitArgs []byte `protobuf:"bytes,4,opt,name=init_args,json=initArgs,proto3,oneof" json:"init_args,omitempty"` +} + +func (*QueryBuildAddressRequest_InitArgs) isQueryBuildAddressRequest_XInitArgs() {} + +func (m *QueryBuildAddressRequest) GetXInitArgs() isQueryBuildAddressRequest_XInitArgs { + if m != nil { + return m.XInitArgs + } + return nil +} + +func (m *QueryBuildAddressRequest) GetInitArgs() []byte { + if x, ok := m.GetXInitArgs().(*QueryBuildAddressRequest_InitArgs); ok { + return x.InitArgs + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*QueryBuildAddressRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*QueryBuildAddressRequest_InitArgs)(nil), + } +} + +// QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC +// method. +type QueryBuildAddressResponse struct { + // Address is the contract address + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryBuildAddressResponse) Reset() { *m = QueryBuildAddressResponse{} } +func (m *QueryBuildAddressResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBuildAddressResponse) ProtoMessage() {} +func (*QueryBuildAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9677c207036b9f2b, []int{24} +} + +func (m *QueryBuildAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *QueryBuildAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBuildAddressResponse.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 *QueryBuildAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBuildAddressResponse.Merge(m, src) +} + +func (m *QueryBuildAddressResponse) XXX_Size() int { + return m.Size() +} + +func (m *QueryBuildAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBuildAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBuildAddressResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*QueryContractInfoRequest)(nil), "cosmwasm.wasm.v1.QueryContractInfoRequest") proto.RegisterType((*QueryContractInfoResponse)(nil), "cosmwasm.wasm.v1.QueryContractInfoResponse") @@ -1106,99 +1236,108 @@ func init() { proto.RegisterType((*QueryParamsResponse)(nil), "cosmwasm.wasm.v1.QueryParamsResponse") proto.RegisterType((*QueryContractsByCreatorRequest)(nil), "cosmwasm.wasm.v1.QueryContractsByCreatorRequest") proto.RegisterType((*QueryContractsByCreatorResponse)(nil), "cosmwasm.wasm.v1.QueryContractsByCreatorResponse") + proto.RegisterType((*QueryBuildAddressRequest)(nil), "cosmwasm.wasm.v1.QueryBuildAddressRequest") + proto.RegisterType((*QueryBuildAddressResponse)(nil), "cosmwasm.wasm.v1.QueryBuildAddressResponse") } func init() { proto.RegisterFile("cosmwasm/wasm/v1/query.proto", fileDescriptor_9677c207036b9f2b) } var fileDescriptor_9677c207036b9f2b = []byte{ - // 1378 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x98, 0xcf, 0x6f, 0x1b, 0x45, - 0x1b, 0xc7, 0x3d, 0xa9, 0xe3, 0x38, 0x93, 0xf6, 0xad, 0x33, 0x6f, 0x69, 0x5d, 0xd3, 0xae, 0xa3, - 0xa5, 0x84, 0xd4, 0x6d, 0xbd, 0x8d, 0xdb, 0x52, 0x51, 0x84, 0x90, 0x9d, 0x42, 0xd3, 0x8a, 0x42, - 0xea, 0x4a, 0x20, 0xc1, 0xc1, 0x8c, 0xbd, 0x13, 0x67, 0xa5, 0x78, 0xc7, 0xdd, 0x99, 0xfe, 0xb0, - 0xa2, 0x70, 0xe8, 0xb5, 0x1c, 0x90, 0x10, 0x07, 0xb8, 0xc0, 0xa1, 0x82, 0x4a, 0x08, 0x09, 0x01, - 0x87, 0x8a, 0x2b, 0x97, 0x1c, 0x2b, 0xb8, 0x70, 0xb2, 0xc0, 0x45, 0x02, 0xf5, 0x4f, 0xe8, 0x09, - 0xed, 0xcc, 0xac, 0xbd, 0x6b, 0x7b, 0xed, 0x25, 0xf8, 0xc0, 0xc5, 0x5a, 0xef, 0x3c, 0xcf, 0x3c, - 0x9f, 0xf9, 0xce, 0x33, 0xf3, 0x3c, 0x36, 0x3c, 0x52, 0xa3, 0xac, 0x71, 0x1b, 0xb3, 0x86, 0x21, - 0x3e, 0x6e, 0x2d, 0x1b, 0x37, 0x6e, 0x12, 0xa7, 0x95, 0x6f, 0x3a, 0x94, 0x53, 0x94, 0xf2, 0x46, - 0xf3, 0xe2, 0xe3, 0xd6, 0x72, 0xe6, 0x40, 0x9d, 0xd6, 0xa9, 0x18, 0x34, 0xdc, 0x27, 0x69, 0x97, - 0x19, 0x9c, 0x85, 0xb7, 0x9a, 0x84, 0x79, 0xa3, 0x75, 0x4a, 0xeb, 0x9b, 0xc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5, 0x82, 0x00, 0x3d, 0x89, 0x72, - 0xc3, 0x40, 0x4d, 0x62, 0x6c, 0xa9, 0xab, 0x61, 0xdb, 0xe8, 0xb5, 0xae, 0x5f, 0x01, 0x98, 0xea, - 0xef, 0xe7, 0x50, 0x58, 0xe0, 0x90, 0xae, 0x34, 0x63, 0x44, 0xb6, 0x8f, 0x42, 0x3a, 0x20, 0x29, - 0x13, 0x50, 0xdf, 0x01, 0x98, 0xea, 0x6f, 0xb0, 0x42, 0x49, 0x43, 0x9a, 0xbf, 0x50, 0xd2, 0xb0, - 0xce, 0x4d, 0x7f, 0x45, 0x90, 0x9e, 0x47, 0xe7, 0x22, 0x91, 0x3a, 0xf8, 0xb6, 0xb1, 0xd5, 0x6b, - 0xbf, 0xb6, 0xd1, 0x8f, 0x00, 0xa2, 0xc1, 0x96, 0x0a, 0x9d, 0x0e, 0xc1, 0x08, 0x6d, 0x05, 0x33, - 0xcb, 0xff, 0xc0, 0x43, 0xa1, 0xbf, 0x2a, 0xd0, 0x5f, 0x42, 0xe7, 0xa3, 0x89, 0xec, 0x4e, 0x14, - 0x84, 0x6f, 0xc1, 0xb8, 0x48, 0x5b, 0x3d, 0x34, 0x0f, 0x7b, 0xb9, 0xfa, 0xdc, 0x48, 0x1b, 0x45, - 0xb4, 0x24, 0x88, 0x74, 0xb4, 0x30, 0x2e, 0x41, 0x91, 0x03, 0xa7, 0x45, 0x61, 0x43, 0xa3, 0xe6, - 0xf5, 0xca, 0x4d, 0xe6, 0xd8, 0x68, 0x23, 0x15, 0x5d, 0x13, 0xd1, 0xd3, 0xe8, 0xe0, 0xf0, 0xe8, - 0xe8, 0x43, 0x00, 0xe7, 0x7c, 0x35, 0x15, 0x1d, 0x0f, 0x99, 0x75, 0xb0, 0xb6, 0x67, 0x72, 0x51, - 0x4c, 0x15, 0xc6, 0xa2, 0xc0, 0x58, 0x40, 0xda, 0x70, 0x0c, 0x66, 0x34, 0x85, 0x13, 0xda, 0x86, - 0x09, 0x59, 0x0c, 0x51, 0xd8, 0xf2, 0x02, 0x35, 0x37, 0xf3, 0xfc, 0x18, 0xab, 0xc8, 0xe1, 0x65, - 0xd0, 0x87, 0x00, 0xa2, 0xc1, 0xda, 0x15, 0x9a, 0xb9, 0xa1, 0x45, 0x39, 0x34, 0x73, 0xc3, 0x0b, - 0x63, 0x94, 0x43, 0xc7, 0x0c, 0x55, 0xb8, 0x8d, 0xad, 0xbe, 0x92, 0xbf, 0x5d, 0x5a, 0xdd, 0xf9, - 0x5d, 0x8b, 0x3d, 0xe8, 0x68, 0xb1, 0x9d, 0x8e, 0x06, 0x1e, 0x75, 0x34, 0xf0, 0x5b, 0x47, 0x03, - 0x1f, 0x3d, 0xd6, 0x62, 0x8f, 0x1e, 0x6b, 0xb1, 0x5f, 0x1f, 0x6b, 0xb1, 0x77, 0x17, 0x7d, 0x6d, - 0xfe, 0x0a, 0x65, 0x8d, 0x77, 0xbc, 0x10, 0xa6, 0x71, 0x47, 0x86, 0x12, 0x7f, 0xc3, 0x55, 0x13, - 0xe2, 0xff, 0xb0, 0x33, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x21, 0x39, 0xc1, 0xed, 0x13, - 0x00, 0x00, + // 1492 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xf7, 0xa4, 0x8e, 0x63, 0xbf, 0xe4, 0xdb, 0x3a, 0xf3, 0x2d, 0xad, 0xeb, 0xb6, 0x76, 0xb4, + 0x94, 0x90, 0xba, 0xad, 0xb7, 0x49, 0x5b, 0x2a, 0x8a, 0x10, 0xb2, 0x53, 0x68, 0x5a, 0x51, 0x9a, + 0x6e, 0x25, 0x90, 0xe0, 0x60, 0xc6, 0xde, 0x89, 0xb3, 0x92, 0xbd, 0xeb, 0xee, 0x4c, 0xda, 0x5a, + 0x51, 0x38, 0xf4, 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e4, 0x2f, 0x0e, + 0x44, 0xee, 0xa2, 0x09, 0x40, 0xff, 0xa0, 0x83, 0x55, 0x56, 0x6c, 0x3a, 0x00, 0x3c, 0x56, 0x0f, + 0xc2, 0x44, 0xc5, 0xd2, 0x69, 0xc9, 0xd0, 0x05, 0xab, 0x51, 0x2d, 0xe6, 0xbc, 0x5e, 0xd6, 0x47, + 0x46, 0xdd, 0xe7, 0x9d, 0xd4, 0xb5, 0x01, 0x48, 0xea, 0x5e, 0x82, 0x84, 0x97, 0x0d, 0x2e, 0x79, + 0xfd, 0x76, 0x76, 0x47, 0x74, 0x74, 0x0c, 0x7d, 0xe6, 0x21, 0x2c, 0xd4, 0x6a, 0x1e, 0xc8, 0x1b, + 0x9c, 0x70, 0xfa, 0x5f, 0xc8, 0xbc, 0x07, 0x08, 0x8e, 0x86, 0x80, 0x93, 0xfc, 0x5d, 0x80, 0x58, + 0xdd, 0xd2, 0x69, 0xcd, 0xcb, 0xbc, 0x83, 0xdd, 0x99, 0x77, 0xd5, 0x59, 0xf7, 0xa7, 0x99, 0xd4, + 0x18, 0x1d, 0x87, 0x37, 0x25, 0x85, 0x1a, 0xb9, 0x3d, 0x32, 0x0a, 0x8f, 0x02, 0x08, 0xef, 0x25, + 0x9d, 0x70, 0x22, 0xc0, 0x4d, 0x69, 0x09, 0xf1, 0xe5, 0x22, 0xe1, 0x44, 0x39, 0x23, 0x89, 0xe9, + 0x76, 0x29, 0x89, 0xc1, 0x10, 0x15, 0x9a, 0x48, 0x68, 0x8a, 0x67, 0xe5, 0x1e, 0x82, 0x8c, 0xd0, + 0xba, 0x51, 0x27, 0x36, 0x1f, 0x19, 0xd4, 0x73, 0xdd, 0x50, 0x8b, 0x07, 0x9e, 0xb6, 0xb2, 0xd8, + 0x07, 0xee, 0x2a, 0x65, 0xcc, 0xa1, 0xcf, 0x17, 0xc2, 0x55, 0xc8, 0x86, 0x82, 0x91, 0x41, 0xe4, + 0xfc, 0x41, 0x84, 0xda, 0x74, 0x83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0x29, 0x2f, 0xc6, 0xbd, + 0xce, 0xa8, 0xc5, 0x2b, 0x72, 0x0d, 0x1f, 0x91, 0x9b, 0xee, 0x26, 0x52, 0x7c, 0xbb, 0x95, 0x15, + 0xef, 0xee, 0x36, 0xcb, 0x76, 0xf9, 0x9e, 0x0f, 0x03, 0xf3, 0x76, 0x3b, 0x58, 0x75, 0xd0, 0xae, + 0xab, 0xce, 0xd7, 0x08, 0xb0, 0xdf, 0xba, 0x0c, 0xf1, 0x4d, 0x80, 0x76, 0x88, 0x5e, 0xb9, 0x19, + 0x26, 0x46, 0x1f, 0xc9, 0x09, 0x2f, 0xc8, 0x11, 0x16, 0x1f, 0x02, 0x07, 0x05, 0xd8, 0x65, 0xc3, + 0x34, 0xa9, 0xde, 0x87, 0x90, 0xdd, 0x97, 0xe1, 0x7b, 0x48, 0x4e, 0x67, 0x01, 0x1f, 0x92, 0x96, + 0x59, 0x88, 0xcb, 0x53, 0xe3, 0x92, 0x12, 0x2d, 0x4e, 0x6e, 0xb5, 0xb2, 0x13, 0xee, 0xb1, 0x61, + 0xda, 0x84, 0x7b, 0x62, 0x46, 0x18, 0xf0, 0x7e, 0xb9, 0x3b, 0xcb, 0xc4, 0x26, 0x75, 0x2f, 0x56, + 0x45, 0x83, 0xff, 0x07, 0xbe, 0x4a, 0x74, 0xaf, 0x40, 0xac, 0x21, 0xbe, 0xc8, 0x7c, 0x48, 0x75, + 0x6f, 0x98, 0xab, 0x11, 0x68, 0x10, 0xae, 0x8a, 0x93, 0x08, 0x99, 0xae, 0xee, 0xed, 0x9e, 0x66, + 0x8f, 0xe2, 0x02, 0xec, 0x93, 0xe7, 0xbb, 0x34, 0x6c, 0xdd, 0xdc, 0x2b, 0x15, 0x0a, 0x23, 0x6e, + 0x96, 0xdf, 0x23, 0x59, 0x50, 0x7b, 0xa1, 0x95, 0x74, 0x5c, 0x02, 0xdc, 0x1e, 0x62, 0x25, 0x5e, + 0x3a, 0x78, 0xee, 0x98, 0xf6, 0x74,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x98, 0x3b, 0x1e, 0xe0, 0xb0, 0xf0, 0x02, 0x53, 0x48, 0xfa, 0x85, 0x01, 0x52, 0x43, 0xbb, + 0x77, 0x9d, 0x3e, 0x42, 0x80, 0xbb, 0xbb, 0x79, 0x68, 0xe6, 0x86, 0x8e, 0x29, 0xa1, 0x99, 0x1b, + 0x3e, 0x2a, 0x0c, 0x73, 0xe8, 0x98, 0x2a, 0xfb, 0xa9, 0xba, 0xde, 0xd1, 0x89, 0x37, 0xf0, 0x7d, + 0x04, 0x53, 0xfe, 0x96, 0x18, 0xda, 0xbb, 0x7a, 0xf4, 0xfd, 0xd0, 0xde, 0xd5, 0xab, 0xc7, 0x2a, + 0xa7, 0x05, 0xd0, 0x1c, 0x9e, 0xeb, 0x73, 0xc4, 0xca, 0x8e, 0xa2, 0x07, 0xae, 0xb8, 0xb4, 0xf9, + 0x47, 0x26, 0xf2, 0x70, 0x2b, 0x13, 0xd9, 0xdc, 0xca, 0xa0, 0xc7, 0x5b, 0x19, 0xf4, 0xfb, 0x56, + 0x06, 0x7d, 0xfc, 0x24, 0x13, 0x79, 0xfc, 0x24, 0x13, 0xf9, 0xf5, 0x49, 0x26, 0xf2, 0xee, 0xac, + 0xef, 0x52, 0xb6, 0x68, 0xb1, 0xfa, 0x3b, 0x9e, 0x55, 0x5d, 0xbd, 0xe3, 0x5a, 0x17, 0x7f, 0x9a, + 0x96, 0x63, 0xe2, 0xdf, 0xcb, 0x33, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xa6, 0x0e, 0x42, 0xcc, + 0x9b, 0x15, 0x00, 0x00, } func (this *QueryContractInfoResponse) Equal(that interface{}) bool { @@ -1327,6 +1466,8 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // ContractsByCreator gets the contracts by creator ContractsByCreator(ctx context.Context, in *QueryContractsByCreatorRequest, opts ...grpc.CallOption) (*QueryContractsByCreatorResponse, error) + // BuildAddress builds a contract address + BuildAddress(ctx context.Context, in *QueryBuildAddressRequest, opts ...grpc.CallOption) (*QueryBuildAddressResponse, error) } type queryClient struct { @@ -1436,6 +1577,15 @@ func (c *queryClient) ContractsByCreator(ctx context.Context, in *QueryContracts return out, nil } +func (c *queryClient) BuildAddress(ctx context.Context, in *QueryBuildAddressRequest, opts ...grpc.CallOption) (*QueryBuildAddressResponse, error) { + out := new(QueryBuildAddressResponse) + err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Query/BuildAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // ContractInfo gets the contract meta data @@ -1460,6 +1610,8 @@ type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // ContractsByCreator gets the contracts by creator ContractsByCreator(context.Context, *QueryContractsByCreatorRequest) (*QueryContractsByCreatorResponse, error) + // BuildAddress builds a contract address + BuildAddress(context.Context, *QueryBuildAddressRequest) (*QueryBuildAddressResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1509,6 +1661,10 @@ func (*UnimplementedQueryServer) ContractsByCreator(ctx context.Context, req *Qu return nil, status.Errorf(codes.Unimplemented, "method ContractsByCreator not implemented") } +func (*UnimplementedQueryServer) BuildAddress(ctx context.Context, req *QueryBuildAddressRequest) (*QueryBuildAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BuildAddress not implemented") +} + func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } @@ -1711,6 +1867,24 @@ func _Query_ContractsByCreator_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Query_BuildAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBuildAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BuildAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmwasm.wasm.v1.Query/BuildAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BuildAddress(ctx, req.(*QueryBuildAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmwasm.wasm.v1.Query", HandlerType: (*QueryServer)(nil), @@ -1759,6 +1933,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "ContractsByCreator", Handler: _Query_ContractsByCreator_Handler, }, + { + MethodName: "BuildAddress", + Handler: _Query_BuildAddress_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmwasm/wasm/v1/query.proto", @@ -2670,6 +2848,106 @@ func (m *QueryContractsByCreatorResponse) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } +func (m *QueryBuildAddressRequest) 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 *QueryBuildAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBuildAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XInitArgs != nil { + { + size := m.XInitArgs.Size() + i -= size + if _, err := m.XInitArgs.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.Salt) > 0 { + i -= len(m.Salt) + copy(dAtA[i:], m.Salt) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Salt))) + i-- + dAtA[i] = 0x1a + } + if len(m.CreatorAddress) > 0 { + i -= len(m.CreatorAddress) + copy(dAtA[i:], m.CreatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.CreatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.CodeHash) > 0 { + i -= len(m.CodeHash) + copy(dAtA[i:], m.CodeHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.CodeHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBuildAddressRequest_InitArgs) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBuildAddressRequest_InitArgs) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.InitArgs != nil { + i -= len(m.InitArgs) + copy(dAtA[i:], m.InitArgs) + i = encodeVarintQuery(dAtA, i, uint64(len(m.InitArgs))) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} + +func (m *QueryBuildAddressResponse) 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 *QueryBuildAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBuildAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -3049,6 +3327,56 @@ func (m *QueryContractsByCreatorResponse) Size() (n int) { return n } +func (m *QueryBuildAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CodeHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.CreatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Salt) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.XInitArgs != nil { + n += m.XInitArgs.Size() + } + return n +} + +func (m *QueryBuildAddressRequest_InitArgs) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.InitArgs != nil { + l = len(m.InitArgs) + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBuildAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5556,6 +5884,269 @@ func (m *QueryContractsByCreatorResponse) Unmarshal(dAtA []byte) error { return nil } +func (m *QueryBuildAddressRequest) 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: QueryBuildAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBuildAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CodeHash", 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.CodeHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatorAddress", 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.CreatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Salt", 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.Salt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitArgs", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := make([]byte, postIndex-iNdEx) + copy(v, dAtA[iNdEx:postIndex]) + m.XInitArgs = &QueryBuildAddressRequest_InitArgs{v} + 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 *QueryBuildAddressResponse) 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: QueryBuildAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBuildAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = 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 skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/wasm/types/query.pb.gw.go b/x/wasm/types/query.pb.gw.go index 32f3fd25cd..a07546a819 100644 --- a/x/wasm/types/query.pb.gw.go +++ b/x/wasm/types/query.pb.gw.go @@ -639,6 +639,38 @@ func local_request_Query_ContractsByCreator_0(ctx context.Context, marshaler run return msg, metadata, err } +var filter_Query_BuildAddress_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + +func request_Query_BuildAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBuildAddressRequest + 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_BuildAddress_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.BuildAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Query_BuildAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBuildAddressRequest + 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_BuildAddress_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.BuildAddress(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. @@ -886,6 +918,28 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv forward_Query_ContractsByCreator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle("GET", pattern_Query_BuildAddress_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_BuildAddress_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_BuildAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil } @@ -1135,6 +1189,25 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie forward_Query_ContractsByCreator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle("GET", pattern_Query_BuildAddress_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_BuildAddress_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_BuildAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil } @@ -1160,6 +1233,8 @@ var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmwasm", "wasm", "v1", "codes", "params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_ContractsByCreator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmwasm", "wasm", "v1", "contracts", "creator", "creator_address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_BuildAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmwasm", "wasm", "v1", "contract", "build_address"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1184,4 +1259,6 @@ var ( forward_Query_Params_0 = runtime.ForwardResponseMessage forward_Query_ContractsByCreator_0 = runtime.ForwardResponseMessage + + forward_Query_BuildAddress_0 = runtime.ForwardResponseMessage ) From a18d35ba2c3e7dd0c6f70c931a22becfb8801aa9 Mon Sep 17 00:00:00 2001 From: Jeremy Liu <31809888+NotJeremyLiu@users.noreply.github.com> Date: Sat, 9 Dec 2023 20:48:32 -0700 Subject: [PATCH 02/10] change init args to bytes --- docs/proto/proto-docs.md | 2 +- proto/cosmwasm/wasm/v1/query.proto | 4 +- x/wasm/types/query.pb.go | 282 +++++++++++------------------ 3 files changed, 112 insertions(+), 176 deletions(-) diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index 7ee59b02c0..e544950c0b 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -1032,7 +1032,7 @@ method. | `code_hash` | [string](#string) | | CodeHash is the hash of the code | | `creator_address` | [string](#string) | | CreatorAddress is the address of the contract instantiator | | `salt` | [string](#string) | | Salt is a hex encoded salt | -| `init_args` | [bytes](#bytes) | optional | InitArgs are the json encoded init args to be used in contract address building if provided | +| `init_args` | [bytes](#bytes) | | InitArgs are optional json encoded init args to be used in contract address building if provided | diff --git a/proto/cosmwasm/wasm/v1/query.proto b/proto/cosmwasm/wasm/v1/query.proto index cca692da33..e0963784ad 100644 --- a/proto/cosmwasm/wasm/v1/query.proto +++ b/proto/cosmwasm/wasm/v1/query.proto @@ -285,9 +285,9 @@ message QueryBuildAddressRequest { string creator_address = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Salt is a hex encoded salt string salt = 3; - // InitArgs are the json encoded init args to be used in contract address + // InitArgs are optional json encoded init args to be used in contract address // building if provided - optional bytes init_args = 4; + bytes init_args = 4; } // QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC diff --git a/x/wasm/types/query.pb.go b/x/wasm/types/query.pb.go index afd5ff5af7..53156a02f1 100644 --- a/x/wasm/types/query.pb.go +++ b/x/wasm/types/query.pb.go @@ -1091,9 +1091,9 @@ type QueryBuildAddressRequest struct { CreatorAddress string `protobuf:"bytes,2,opt,name=creator_address,json=creatorAddress,proto3" json:"creator_address,omitempty"` // Salt is a hex encoded salt Salt string `protobuf:"bytes,3,opt,name=salt,proto3" json:"salt,omitempty"` - // Types that are valid to be assigned to XInitArgs: - // *QueryBuildAddressRequest_InitArgs - XInitArgs isQueryBuildAddressRequest_XInitArgs `protobuf_oneof:"_init_args"` + // InitArgs are optional json encoded init args to be used in contract address + // building if provided + InitArgs []byte `protobuf:"bytes,4,opt,name=init_args,json=initArgs,proto3" json:"init_args,omitempty"` } func (m *QueryBuildAddressRequest) Reset() { *m = QueryBuildAddressRequest{} } @@ -1134,39 +1134,6 @@ func (m *QueryBuildAddressRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryBuildAddressRequest proto.InternalMessageInfo -type isQueryBuildAddressRequest_XInitArgs interface { - isQueryBuildAddressRequest_XInitArgs() - MarshalTo([]byte) (int, error) - Size() int -} - -type QueryBuildAddressRequest_InitArgs struct { - InitArgs []byte `protobuf:"bytes,4,opt,name=init_args,json=initArgs,proto3,oneof" json:"init_args,omitempty"` -} - -func (*QueryBuildAddressRequest_InitArgs) isQueryBuildAddressRequest_XInitArgs() {} - -func (m *QueryBuildAddressRequest) GetXInitArgs() isQueryBuildAddressRequest_XInitArgs { - if m != nil { - return m.XInitArgs - } - return nil -} - -func (m *QueryBuildAddressRequest) GetInitArgs() []byte { - if x, ok := m.GetXInitArgs().(*QueryBuildAddressRequest_InitArgs); ok { - return x.InitArgs - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*QueryBuildAddressRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*QueryBuildAddressRequest_InitArgs)(nil), - } -} - // QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC // method. type QueryBuildAddressResponse struct { @@ -1243,101 +1210,100 @@ func init() { func init() { proto.RegisterFile("cosmwasm/wasm/v1/query.proto", fileDescriptor_9677c207036b9f2b) } var fileDescriptor_9677c207036b9f2b = []byte{ - // 1492 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xf7, 0xa4, 0x8e, 0x63, 0xbf, 0xe4, 0xdb, 0x3a, 0xf3, 0x2d, 0xad, 0xeb, 0xb6, 0x76, 0xb4, - 0x94, 0x90, 0xba, 0xad, 0xb7, 0x49, 0x5b, 0x2a, 0x8a, 0x10, 0xb2, 0x53, 0x68, 0x5a, 0x51, 0x9a, - 0x6e, 0x25, 0x90, 0xe0, 0x60, 0xc6, 0xde, 0x89, 0xb3, 0x92, 0xbd, 0xeb, 0xee, 0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0xc2, 0xb9, 0xd2, 0xab, 0x09, 0x04, 0x29, 0x2f, 0xc6, 0xbd, - 0xce, 0xa8, 0xc5, 0x2b, 0x72, 0x0d, 0x1f, 0x91, 0x9b, 0xee, 0x26, 0x52, 0x7c, 0xbb, 0x95, 0x15, - 0xef, 0xee, 0x36, 0xcb, 0x76, 0xf9, 0x9e, 0x0f, 0x03, 0xf3, 0x76, 0x3b, 0x58, 0x75, 0xd0, 0xae, - 0xab, 0xce, 0xd7, 0x08, 0xb0, 0xdf, 0xba, 0x0c, 0xf1, 0x4d, 0x80, 0x76, 0x88, 0x5e, 0xb9, 0x19, - 0x26, 0x46, 0x1f, 0xc9, 0x09, 0x2f, 0xc8, 0x11, 0x16, 0x1f, 0x02, 0x07, 0x05, 0xd8, 0x65, 0xc3, - 0x34, 0xa9, 0xde, 0x87, 0x90, 0xdd, 0x97, 0xe1, 0x7b, 0x48, 0x4e, 0x67, 0x01, 0x1f, 0x92, 0x96, - 0x59, 0x88, 0xcb, 0x53, 0xe3, 0x92, 0x12, 0x2d, 0x4e, 0x6e, 0xb5, 0xb2, 0x13, 0xee, 0xb1, 0x61, - 0xda, 0x84, 0x7b, 0x62, 0x46, 0x18, 0xf0, 0x7e, 0xb9, 0x3b, 0xcb, 0xc4, 0x26, 0x75, 0x2f, 0x56, - 0x45, 0x83, 0xff, 0x07, 0xbe, 0x4a, 0x74, 0xaf, 0x40, 0xac, 0x21, 0xbe, 0xc8, 0x7c, 0x48, 0x75, - 0x6f, 0x98, 0xab, 0x11, 0x68, 0x10, 0xae, 0x8a, 0x93, 0x08, 0x99, 0xae, 0xee, 0xed, 0x9e, 0x66, - 0x8f, 0xe2, 0x02, 0xec, 0x93, 0xe7, 0xbb, 0x34, 0x6c, 0xdd, 0xdc, 0x2b, 0x15, 0x0a, 0x23, 0x6e, - 0x96, 0xdf, 0x23, 0x59, 0x50, 0x7b, 0xa1, 0x95, 0x74, 0x5c, 0x02, 0xdc, 0x1e, 0x62, 0x25, 0x5e,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0xa6, 0x36, 0x84, 0x12, 0xde, - 0x80, 0x98, 0x3b, 0x1e, 0xe0, 0xb0, 0xf0, 0x02, 0x53, 0x48, 0xfa, 0x85, 0x01, 0x52, 0x43, 0xbb, - 0x77, 0x9d, 0x3e, 0x42, 0x80, 0xbb, 0xbb, 0x79, 0x68, 0xe6, 0x86, 0x8e, 0x29, 0xa1, 0x99, 0x1b, - 0x3e, 0x2a, 0x0c, 0x73, 0xe8, 0x98, 0x2a, 0xfb, 0xa9, 0xba, 0xde, 0xd1, 0x89, 0x37, 0xf0, 0x7d, - 0x04, 0x53, 0xfe, 0x96, 0x18, 0xda, 0xbb, 0x7a, 0xf4, 0xfd, 0xd0, 0xde, 0xd5, 0xab, 0xc7, 0x2a, - 0xa7, 0x05, 0xd0, 0x1c, 0x9e, 0xeb, 0x73, 0xc4, 0xca, 0x8e, 0xa2, 0x07, 0xae, 0xb8, 0xb4, 0xf9, - 0x47, 0x26, 0xf2, 0x70, 0x2b, 0x13, 0xd9, 0xdc, 0xca, 0xa0, 0xc7, 0x5b, 0x19, 0xf4, 0xfb, 0x56, - 0x06, 0x7d, 0xfc, 0x24, 0x13, 0x79, 0xfc, 0x24, 0x13, 0xf9, 0xf5, 0x49, 0x26, 0xf2, 0xee, 0xac, - 0xef, 0x52, 0xb6, 0x68, 0xb1, 0xfa, 0x3b, 0x9e, 0x55, 0x5d, 0xbd, 0xe3, 0x5a, 0x17, 0x7f, 0x9a, - 0x96, 0x63, 0xe2, 0xdf, 0xcb, 0x33, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xa6, 0x0e, 0x42, 0xcc, - 0x9b, 0x15, 0x00, 0x00, + // 1476 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xa4, 0x8e, 0x63, 0x4f, 0x42, 0xeb, 0x0c, 0xa5, 0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, 0xd7, 0xe0, 0x04, 0xb1, 0x99, 0x6b, 0x11, 0x0f, 0xdc, + 0x9e, 0xb9, 0xc9, 0x85, 0x6c, 0x38, 0x29, 0x8b, 0x8e, 0x49, 0xa4, 0xfe, 0xdb, 0x36, 0x73, 0x9b, + 0x85, 0xc4, 0xe6, 0x0e, 0x31, 0xca, 0x0a, 0xba, 0xd4, 0x03, 0xf9, 0xab, 0x03, 0x91, 0x0b, 0x34, + 0x01, 0xe8, 0x9f, 0x74, 0xb0, 0x4a, 0x0b, 0x4d, 0x0f, 0x80, 0x62, 0xf5, 0x20, 0x9c, 0xa8, 0x38, + 0x26, 0x29, 0x59, 0x26, 0x67, 0x35, 0x5a, 0x8c, 0x79, 0xaf, 0x97, 0xcd, 0x91, 0x51, 0xf7, 0x55, + 0x27, 0x75, 0x3b, 0x00, 0x24, 0x75, 0xaf, 0xc1, 0x84, 0xca, 0x06, 0x41, 0x5e, 0xbf, 0x9d, 0x6d, + 0x8b, 0x8e, 0x8e, 0xa1, 0x2f, 0x15, 0xc2, 0x7c, 0xad, 0xa6, 0x40, 0xde, 0x60, 0x98, 0x91, 0xff, + 0x43, 0xe6, 0x3d, 0x00, 0xf0, 0x68, 0x08, 0x38, 0xc9, 0xdf, 0x05, 0x18, 0xab, 0x3b, 0x26, 0xa9, + 0xa9, 0xcc, 0x3b, 0xd8, 0x9d, 0x79, 0x57, 0xbd, 0x75, 0x7f, 0x9a, 0x49, 0x8d, 0xd1, 0x71, 0x78, + 0x53, 0x52, 0x58, 0xc4, 0xb7, 0x47, 0x46, 0xe1, 0x51, 0x08, 0xb9, 0xf7, 0x92, 0x89, 0x19, 0xe6, + 0xe0, 0xa6, 0x8a, 0x09, 0xfe, 0xe5, 0x22, 0x66, 0x58, 0x3f, 0x23, 0x89, 0xe9, 0x76, 0x29, 0x89, + 0x41, 0x30, 0xca, 0x35, 0x01, 0xd7, 0xe4, 0xcf, 0xfa, 0x3d, 0x00, 0x35, 0xae, 0x75, 0xa3, 0x8e, + 0x5d, 0x36, 0x32, 0xa8, 0xe7, 0xba, 0xa1, 0x16, 0x0e, 0x3c, 0x6b, 0x65, 0x90, 0x0f, 0xdc, 0x55, + 0x42, 0xa9, 0x47, 0x9f, 0x2f, 0x84, 0xab, 0x30, 0x13, 0x0a, 0x46, 0x06, 0x91, 0xf5, 0x07, 0x11, + 0x6a, 0x53, 0x04, 0x77, 0x02, 0x26, 0xe5, 0x49, 0x1b, 0x7c, 0xbe, 0xf5, 0xc7, 0x63, 0x30, 0xe9, + 0x09, 0x06, 0xba, 0xc2, 0xf1, 0x0e, 0xe9, 0x42, 0x72, 0xab, 0x95, 0x89, 0x71, 0xb1, 0x8b, 0xdb, + 0xad, 0xcc, 0x98, 0x65, 0xee, 0xd4, 0x87, 0x05, 0x38, 0x51, 0x71, 0x09, 0x66, 0x8e, 0xcb, 0xe3, + 0xed, 0x4b, 0x93, 0x14, 0x44, 0xd7, 0x61, 0xc2, 0x03, 0x5a, 0x5a, 0xc5, 0x74, 0x35, 0xb5, 0x87, + 0x47, 0x74, 0xf6, 0x59, 0x2b, 0x73, 0xba, 0x6a, 0xb1, 0xd5, 0xb5, 0x72, 0xae, 0xe2, 0xd4, 0x8d, + 0x8a, 0x53, 0x27, 0xac, 0xbc, 0xc2, 0xda, 0x0f, 0x35, 0xab, 0x4c, 0x8d, 0x72, 0x93, 0x11, 0x9a, + 0x5b, 0x22, 0x77, 0x0a, 0xde, 0x43, 0x31, 0xee, 0x99, 0x59, 0xc2, 0x74, 0x15, 0x7d, 0x0c, 0x0f, + 0x58, 0x36, 0x65, 0xd8, 0x66, 0x16, 0x66, 0xa4, 0xd4, 0x20, 0x6e, 0xdd, 0xa2, 0xd4, 0xcb, 0xe6, + 0x58, 0x58, 0x73, 0xca, 0x57, 0x2a, 0x84, 0xd2, 0x45, 0xc7, 0x5e, 0xb1, 0xaa, 0xfe, 0x43, 0xf1, + 0x92, 0xcf, 0xd0, 0xf2, 0x8e, 0x1d, 0xd1, 0x9d, 0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, 0x56, 0xbb, 0x47, 0x9b, 0x74, + 0x76, 0x18, 0x51, 0x09, 0x63, 0x96, 0xc3, 0x98, 0x41, 0x5a, 0x6f, 0x18, 0xd4, 0x68, 0x70, 0x25, + 0xb4, 0x01, 0x63, 0x62, 0x16, 0x40, 0x61, 0xe1, 0x05, 0x46, 0x8e, 0xf4, 0x2b, 0x03, 0xa4, 0x86, + 0x76, 0x2f, 0x9c, 0x3e, 0x06, 0x10, 0x75, 0xb7, 0xee, 0xd0, 0xcc, 0x0d, 0x9d, 0x49, 0x42, 0x33, + 0x37, 0x7c, 0x2e, 0x18, 0xe6, 0xd0, 0x51, 0x43, 0x36, 0x4f, 0x63, 0xbd, 0xa3, 0xed, 0x6e, 0xa0, + 0xfb, 0x00, 0x4e, 0xf9, 0x5b, 0x62, 0x68, 0xef, 0xea, 0xd1, 0xe4, 0x43, 0x7b, 0x57, 0xaf, 0x1e, + 0xab, 0x9f, 0xe6, 0x40, 0xb3, 0x68, 0xae, 0xcf, 0x11, 0x2b, 0x7b, 0x8a, 0x0a, 0x5c, 0x61, 0x69, + 0xf3, 0x4f, 0x2d, 0xf2, 0x70, 0x4b, 0x8b, 0x6c, 0x6e, 0x69, 0xe0, 0xc9, 0x96, 0x06, 0xfe, 0xd8, + 0xd2, 0xc0, 0x67, 0x4f, 0xb5, 0xc8, 0x93, 0xa7, 0x5a, 0xe4, 0xb7, 0xa7, 0x5a, 0xe4, 0xc3, 0x59, + 0xdf, 0x0d, 0x6c, 0xd1, 0xa1, 0xf5, 0x0f, 0x94, 0x55, 0xd3, 0xb8, 0x23, 0xac, 0xf3, 0x7f, 0x48, + 0xcb, 0x31, 0xfe, 0x57, 0xe5, 0x99, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xce, 0x54, 0xc4, 0x89, + 0x88, 0x15, 0x00, 0x00, } func (this *QueryContractInfoResponse) Equal(that interface{}) bool { @@ -2868,14 +2834,12 @@ func (m *QueryBuildAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l - if m.XInitArgs != nil { - { - size := m.XInitArgs.Size() - i -= size - if _, err := m.XInitArgs.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } + if len(m.InitArgs) > 0 { + i -= len(m.InitArgs) + copy(dAtA[i:], m.InitArgs) + i = encodeVarintQuery(dAtA, i, uint64(len(m.InitArgs))) + i-- + dAtA[i] = 0x22 } if len(m.Salt) > 0 { i -= len(m.Salt) @@ -2901,23 +2865,6 @@ func (m *QueryBuildAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *QueryBuildAddressRequest_InitArgs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryBuildAddressRequest_InitArgs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.InitArgs != nil { - i -= len(m.InitArgs) - copy(dAtA[i:], m.InitArgs) - i = encodeVarintQuery(dAtA, i, uint64(len(m.InitArgs))) - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} - func (m *QueryBuildAddressResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3345,20 +3292,8 @@ func (m *QueryBuildAddressRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - if m.XInitArgs != nil { - n += m.XInitArgs.Size() - } - return n -} - -func (m *QueryBuildAddressRequest_InitArgs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.InitArgs != nil { - l = len(m.InitArgs) + l = len(m.InitArgs) + if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n @@ -6038,9 +5973,10 @@ func (m *QueryBuildAddressRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - m.XInitArgs = &QueryBuildAddressRequest_InitArgs{v} + m.InitArgs = append(m.InitArgs[:0], dAtA[iNdEx:postIndex]...) + if m.InitArgs == nil { + m.InitArgs = []byte{} + } iNdEx = postIndex default: iNdEx = preIndex From a59a586196e5a688d64e2e1480262efd3020ded4 Mon Sep 17 00:00:00 2001 From: Jeremy Liu <31809888+NotJeremyLiu@users.noreply.github.com> Date: Sat, 9 Dec 2023 20:48:45 -0700 Subject: [PATCH 03/10] implement BuildAddress grpc query --- x/wasm/keeper/querier.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/x/wasm/keeper/querier.go b/x/wasm/keeper/querier.go index e5bd3575ae..b04acb87e1 100644 --- a/x/wasm/keeper/querier.go +++ b/x/wasm/keeper/querier.go @@ -3,6 +3,7 @@ package keeper import ( "context" "encoding/binary" + "encoding/hex" "runtime/debug" "google.golang.org/grpc/codes" @@ -406,3 +407,36 @@ func ensurePaginationParams(req *query.PageRequest) (*query.PageRequest, error) } return req, nil } + +func (q GrpcQuerier) BuildAddress(c context.Context, req *types.QueryBuildAddressRequest) (*types.QueryBuildAddressResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + codeHash, err := hex.DecodeString(req.CodeHash) + if err != nil { + return nil, err + } + creator, err := sdk.AccAddressFromBech32(req.CreatorAddress) + if err != nil { + return nil, err + } + salt, err := hex.DecodeString(req.Salt) + if err != nil { + return nil, err + } + if len(salt) == 0 { + return nil, status.Error(codes.InvalidArgument, "empty salt") + } + if req.InitArgs == nil { + return &types.QueryBuildAddressResponse{ + Address: BuildContractAddressPredictable(codeHash, creator, salt, []byte{}).String(), + }, nil + } + initMsg := types.RawContractMessage(req.InitArgs) + if err := initMsg.ValidateBasic(); err != nil { + return nil, err + } + return &types.QueryBuildAddressResponse{ + Address: BuildContractAddressPredictable(codeHash, creator, salt, initMsg).String(), + }, nil +} From 3f73a27c5cad37753965373901c026c1bd6874cd Mon Sep 17 00:00:00 2001 From: Jeremy Liu <31809888+NotJeremyLiu@users.noreply.github.com> Date: Sat, 9 Dec 2023 21:45:29 -0700 Subject: [PATCH 04/10] Add unit tests --- x/wasm/keeper/querier_test.go | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/x/wasm/keeper/querier_test.go b/x/wasm/keeper/querier_test.go index 0393dfab6a..72ede66354 100644 --- a/x/wasm/keeper/querier_test.go +++ b/x/wasm/keeper/querier_test.go @@ -1047,3 +1047,60 @@ func TestEnsurePaginationParams(t *testing.T) { }) } } + +func TestQueryBuildAddress(t *testing.T) { + specs := map[string]struct { + srcQuery *types.QueryBuildAddressRequest + exp *types.QueryBuildAddressResponse + expErr error + }{ + "empty request": { + srcQuery: nil, + expErr: status.Error(codes.InvalidArgument, "empty request"), + }, + "valid - without init args": { + srcQuery: &types.QueryBuildAddressRequest{ + CodeHash: "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + CreatorAddress: "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz", + Salt: "61", + InitArgs: nil, + }, + exp: &types.QueryBuildAddressResponse{ + Address: "cosmos165fz7lnnt6e08knjqsz6fnz9drs7gewezyq3pl5uspc3zgt5lldq4ge3pl", + }, + expErr: nil, + }, + "valid - with init args": { + srcQuery: &types.QueryBuildAddressRequest{ + CodeHash: "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + CreatorAddress: "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz", + Salt: "61", + InitArgs: []byte(`{"verifier":"cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz"}`), + }, + exp: &types.QueryBuildAddressResponse{ + Address: "cosmos150kq3ggdvc9lftcv6ns75t3v6lcpxdmvuwtqr6e9fc029z6h4maqepgss6", + }, + expErr: nil, + }, + } + + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) + keeper := keepers.WasmKeeper + + q := Querier(keeper) + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + got, gotErr := q.BuildAddress(ctx, spec.srcQuery) + if spec.expErr != nil { + fmt.Println("here") + fmt.Println("err: ", gotErr) + require.Error(t, gotErr) + assert.ErrorContains(t, gotErr, spec.expErr.Error()) + return + } + require.NoError(t, gotErr) + require.NotNil(t, got) + assert.Equal(t, spec.exp.Address, got.Address) + }) + } +} From 71dee7b5d41a7ec907f312093e4735d5433076c3 Mon Sep 17 00:00:00 2001 From: Jeremy Liu <31809888+NotJeremyLiu@users.noreply.github.com> Date: Thu, 14 Dec 2023 07:48:05 -0700 Subject: [PATCH 05/10] Update x/wasm/keeper/querier_test.go Co-authored-by: pinosu <95283998+pinosu@users.noreply.github.com> --- x/wasm/keeper/querier_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/x/wasm/keeper/querier_test.go b/x/wasm/keeper/querier_test.go index 72ede66354..0bf2743c59 100644 --- a/x/wasm/keeper/querier_test.go +++ b/x/wasm/keeper/querier_test.go @@ -1092,8 +1092,6 @@ func TestQueryBuildAddress(t *testing.T) { t.Run(msg, func(t *testing.T) { got, gotErr := q.BuildAddress(ctx, spec.srcQuery) if spec.expErr != nil { - fmt.Println("here") - fmt.Println("err: ", gotErr) require.Error(t, gotErr) assert.ErrorContains(t, gotErr, spec.expErr.Error()) return From ca8bebe6c05cb80dcae907e045f78046de500d12 Mon Sep 17 00:00:00 2001 From: Jeremy Liu <31809888+NotJeremyLiu@users.noreply.github.com> Date: Tue, 26 Dec 2023 23:07:51 -0700 Subject: [PATCH 06/10] more verbose error messages --- x/wasm/keeper/querier.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x/wasm/keeper/querier.go b/x/wasm/keeper/querier.go index b04acb87e1..f6eb47fcb2 100644 --- a/x/wasm/keeper/querier.go +++ b/x/wasm/keeper/querier.go @@ -4,6 +4,7 @@ import ( "context" "encoding/binary" "encoding/hex" + "fmt" "runtime/debug" "google.golang.org/grpc/codes" @@ -414,15 +415,15 @@ func (q GrpcQuerier) BuildAddress(c context.Context, req *types.QueryBuildAddres } codeHash, err := hex.DecodeString(req.CodeHash) if err != nil { - return nil, err + return nil, fmt.Errorf("invalid code hash: %w", err) } creator, err := sdk.AccAddressFromBech32(req.CreatorAddress) if err != nil { - return nil, err + return nil, fmt.Errorf("invalid creator address: %w", err) } salt, err := hex.DecodeString(req.Salt) if err != nil { - return nil, err + return nil, fmt.Errorf("invalid salt: %w", err) } if len(salt) == 0 { return nil, status.Error(codes.InvalidArgument, "empty salt") From b17c9fbb8fbd7a617879f530f511604b77cedf21 Mon Sep 17 00:00:00 2001 From: Jeremy Liu <31809888+NotJeremyLiu@users.noreply.github.com> Date: Tue, 26 Dec 2023 23:08:30 -0700 Subject: [PATCH 07/10] make CmdBuildAddress use query client instead of keeper --- x/wasm/client/cli/query.go | 41 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/x/wasm/client/cli/query.go b/x/wasm/client/cli/query.go index 7dd820e3fb..9027c8050b 100644 --- a/x/wasm/client/cli/query.go +++ b/x/wasm/client/cli/query.go @@ -18,7 +18,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/CosmWasm/wasmd/x/wasm/types" ) @@ -78,32 +77,30 @@ func GetCmdBuildAddress() *cobra.Command { Aliases: []string{"address"}, Args: cobra.RangeArgs(3, 4), RunE: func(cmd *cobra.Command, args []string) error { - codeHash, err := hex.DecodeString(args[0]) - if err != nil { - return fmt.Errorf("code-hash: %s", err) - } - creator, err := sdk.AccAddressFromBech32(args[1]) + clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { - return fmt.Errorf("creator: %s", err) - } - salt, err := hex.DecodeString(args[2]) - switch { - case err != nil: - return fmt.Errorf("salt: %s", err) - case len(salt) == 0: - return errors.New("empty salt") + return err } - if len(args) == 3 { - cmd.Println(keeper.BuildContractAddressPredictable(codeHash, creator, salt, []byte{}).String()) - return nil + var initArgs []byte + if len(args) == 4 { + initArgs = types.RawContractMessage(args[3]) } - msg := types.RawContractMessage(args[3]) - if err := msg.ValidateBasic(); err != nil { - return fmt.Errorf("init message: %s", err) + + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.BuildAddress( + context.Background(), + &types.QueryBuildAddressRequest{ + CodeHash: args[0], + CreatorAddress: args[1], + Salt: args[2], + InitArgs: initArgs, + }, + ) + if err != nil { + return err } - cmd.Println(keeper.BuildContractAddressPredictable(codeHash, creator, salt, msg).String()) - return nil + return clientCtx.PrintProto(res) }, SilenceUsage: true, } From e405904b253c16e3cfd8191dfda5b63591ba565d Mon Sep 17 00:00:00 2001 From: Jeremy Liu <31809888+NotJeremyLiu@users.noreply.github.com> Date: Tue, 26 Dec 2023 23:13:18 -0700 Subject: [PATCH 08/10] src instead of srcQuery in tests --- x/wasm/keeper/querier_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/x/wasm/keeper/querier_test.go b/x/wasm/keeper/querier_test.go index 0bf2743c59..0ac0c8f21f 100644 --- a/x/wasm/keeper/querier_test.go +++ b/x/wasm/keeper/querier_test.go @@ -1050,16 +1050,16 @@ func TestEnsurePaginationParams(t *testing.T) { func TestQueryBuildAddress(t *testing.T) { specs := map[string]struct { - srcQuery *types.QueryBuildAddressRequest - exp *types.QueryBuildAddressResponse - expErr error + src *types.QueryBuildAddressRequest + exp *types.QueryBuildAddressResponse + expErr error }{ "empty request": { - srcQuery: nil, - expErr: status.Error(codes.InvalidArgument, "empty request"), + src: nil, + expErr: status.Error(codes.InvalidArgument, "empty request"), }, "valid - without init args": { - srcQuery: &types.QueryBuildAddressRequest{ + src: &types.QueryBuildAddressRequest{ CodeHash: "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", CreatorAddress: "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz", Salt: "61", @@ -1071,7 +1071,7 @@ func TestQueryBuildAddress(t *testing.T) { expErr: nil, }, "valid - with init args": { - srcQuery: &types.QueryBuildAddressRequest{ + src: &types.QueryBuildAddressRequest{ CodeHash: "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", CreatorAddress: "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz", Salt: "61", @@ -1090,7 +1090,7 @@ func TestQueryBuildAddress(t *testing.T) { q := Querier(keeper) for msg, spec := range specs { t.Run(msg, func(t *testing.T) { - got, gotErr := q.BuildAddress(ctx, spec.srcQuery) + got, gotErr := q.BuildAddress(ctx, spec.src) if spec.expErr != nil { require.Error(t, gotErr) assert.ErrorContains(t, gotErr, spec.expErr.Error()) From 7d5c13b9b303cb28ba922dc3dc1798e515672a67 Mon Sep 17 00:00:00 2001 From: Jeremy Liu <31809888+NotJeremyLiu@users.noreply.github.com> Date: Tue, 26 Dec 2023 23:20:47 -0700 Subject: [PATCH 09/10] add more test cases --- x/wasm/keeper/querier_test.go | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/x/wasm/keeper/querier_test.go b/x/wasm/keeper/querier_test.go index 0ac0c8f21f..739a2ae43e 100644 --- a/x/wasm/keeper/querier_test.go +++ b/x/wasm/keeper/querier_test.go @@ -1058,6 +1058,42 @@ func TestQueryBuildAddress(t *testing.T) { src: nil, expErr: status.Error(codes.InvalidArgument, "empty request"), }, + "invalid code hash": { + src: &types.QueryBuildAddressRequest{ + CodeHash: "invalid", + CreatorAddress: "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz", + Salt: "61", + InitArgs: nil, + }, + expErr: fmt.Errorf("invalid code hash"), + }, + "invalid creator address": { + src: &types.QueryBuildAddressRequest{ + CodeHash: "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + CreatorAddress: "invalid", + Salt: "61", + InitArgs: nil, + }, + expErr: fmt.Errorf("invalid creator address"), + }, + "invalid salt": { + src: &types.QueryBuildAddressRequest{ + CodeHash: "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + CreatorAddress: "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz", + Salt: "invalid", + InitArgs: nil, + }, + expErr: fmt.Errorf("invalid salt"), + }, + "empty salt": { + src: &types.QueryBuildAddressRequest{ + CodeHash: "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + CreatorAddress: "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz", + Salt: "", + InitArgs: nil, + }, + expErr: status.Error(codes.InvalidArgument, "empty salt"), + }, "valid - without init args": { src: &types.QueryBuildAddressRequest{ CodeHash: "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", From 44b7abd796ab146706f805472bae314ee347a9fc Mon Sep 17 00:00:00 2001 From: Jeremy Liu <31809888+NotJeremyLiu@users.noreply.github.com> Date: Tue, 26 Dec 2023 23:54:24 -0700 Subject: [PATCH 10/10] add test for invalid init args --- x/wasm/keeper/querier_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/x/wasm/keeper/querier_test.go b/x/wasm/keeper/querier_test.go index 739a2ae43e..2036095f0d 100644 --- a/x/wasm/keeper/querier_test.go +++ b/x/wasm/keeper/querier_test.go @@ -1094,6 +1094,15 @@ func TestQueryBuildAddress(t *testing.T) { }, expErr: status.Error(codes.InvalidArgument, "empty salt"), }, + "invalid init args": { + src: &types.QueryBuildAddressRequest{ + CodeHash: "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + CreatorAddress: "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz", + Salt: "61", + InitArgs: []byte(`invalid`), + }, + expErr: fmt.Errorf("invalid"), + }, "valid - without init args": { src: &types.QueryBuildAddressRequest{ CodeHash: "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5",