From 876082145d824206b78275b731982758ea743c93 Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Fri, 8 Jan 2021 13:09:59 +0100 Subject: [PATCH 1/7] Follow naming convention for msg proto --- doc/proto.md | 266 ++++++------ x/wasm/internal/types/genesis.pb.go | 80 ++-- x/wasm/internal/types/genesis.proto | 2 +- x/wasm/internal/types/{msg.go => tx.go} | 0 x/wasm/internal/types/{msg.pb.go => tx.pb.go} | 410 +++++++++--------- x/wasm/internal/types/{msg.proto => tx.proto} | 0 .../types/{msg_test.go => tx_test.go} | 0 7 files changed, 379 insertions(+), 379 deletions(-) rename x/wasm/internal/types/{msg.go => tx.go} (100%) rename x/wasm/internal/types/{msg.pb.go => tx.pb.go} (80%) rename x/wasm/internal/types/{msg.proto => tx.proto} (100%) rename x/wasm/internal/types/{msg_test.go => tx_test.go} (100%) diff --git a/doc/proto.md b/doc/proto.md index 6d83a1162f..7cce573d76 100644 --- a/doc/proto.md +++ b/doc/proto.md @@ -10,14 +10,6 @@ - [GenesisState.GenMsgs](#cosmwasm.wasm.v1beta1.GenesisState.GenMsgs) - [Sequence](#cosmwasm.wasm.v1beta1.Sequence) -- [x/wasm/internal/types/msg.proto](#x/wasm/internal/types/msg.proto) - - [MsgClearAdmin](#cosmwasm.wasm.v1beta1.MsgClearAdmin) - - [MsgExecuteContract](#cosmwasm.wasm.v1beta1.MsgExecuteContract) - - [MsgInstantiateContract](#cosmwasm.wasm.v1beta1.MsgInstantiateContract) - - [MsgMigrateContract](#cosmwasm.wasm.v1beta1.MsgMigrateContract) - - [MsgStoreCode](#cosmwasm.wasm.v1beta1.MsgStoreCode) - - [MsgUpdateAdmin](#cosmwasm.wasm.v1beta1.MsgUpdateAdmin) - - [x/wasm/internal/types/proposal.proto](#x/wasm/internal/types/proposal.proto) - [ClearAdminProposal](#cosmwasm.wasm.v1beta1.ClearAdminProposal) - [InstantiateContractProposal](#cosmwasm.wasm.v1beta1.InstantiateContractProposal) @@ -47,6 +39,14 @@ - [Query](#cosmwasm.wasm.v1beta1.Query) +- [x/wasm/internal/types/tx.proto](#x/wasm/internal/types/tx.proto) + - [MsgClearAdmin](#cosmwasm.wasm.v1beta1.MsgClearAdmin) + - [MsgExecuteContract](#cosmwasm.wasm.v1beta1.MsgExecuteContract) + - [MsgInstantiateContract](#cosmwasm.wasm.v1beta1.MsgInstantiateContract) + - [MsgMigrateContract](#cosmwasm.wasm.v1beta1.MsgMigrateContract) + - [MsgStoreCode](#cosmwasm.wasm.v1beta1.MsgStoreCode) + - [MsgUpdateAdmin](#cosmwasm.wasm.v1beta1.MsgUpdateAdmin) + - [x/wasm/internal/types/types.proto](#x/wasm/internal/types/types.proto) - [AbsoluteTxPosition](#cosmwasm.wasm.v1beta1.AbsoluteTxPosition) - [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) @@ -127,7 +127,7 @@ GenesisState - genesis state of x/wasm ### GenesisState.GenMsgs -GenMsgs define the messages that can be executed during genesis phase. +GenMsgs define the messages that can be executed during genesis phase in order. The intention is to have more human readable data that is auditable. @@ -167,130 +167,6 @@ Sequence key and value of an id generation counter - -

Top

- -## x/wasm/internal/types/msg.proto - - - - - -### MsgClearAdmin -MsgClearAdmin removes any admin stored for a smart contract - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| sender | [string](#string) | | Sender is the that actor that signed the messages | -| contract | [string](#string) | | Contract is the address of the smart contract | - - - - - - - - -### MsgExecuteContract -MsgExecuteContract submits the given message data to a smart contract - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| sender | [string](#string) | | Sender is the that actor that signed the messages | -| contract | [string](#string) | | Contract is the address of the smart contract | -| msg | [bytes](#bytes) | | Msg json encoded message to be passed to the contract | -| sent_funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | SentFunds coins that are transferred to the contract on execution | - - - - - - - - -### MsgInstantiateContract -MsgInstantiateContract create a new smart contract instance for the given code id. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| sender | [string](#string) | | Sender is the that actor that signed the messages | -| admin | [string](#string) | | Admin is an optional address that can execute migrations | -| code_id | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | -| label | [string](#string) | | Label is optional metadata to be stored with a contract instance. | -| init_msg | [bytes](#bytes) | | InitMsg json encoded message to be passed to the contract on instantiation | -| init_funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | InitFunds coins that are transferred to the contract on instantiation | - - - - - - - - -### MsgMigrateContract -MsgMigrateContract runs a code upgrade/ downgrade for a smart contract - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| sender | [string](#string) | | Sender is the that actor that signed the messages | -| contract | [string](#string) | | Contract is the address of the smart contract | -| code_id | [uint64](#uint64) | | CodeID references the new WASM code | -| migrate_msg | [bytes](#bytes) | | MigrateMsg json encoded message to be passed to the contract on migration | - - - - - - - - -### MsgStoreCode -MsgStoreCode submit Wasm code to the system - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| sender | [string](#string) | | Sender is the that actor that signed the messages | -| wasm_byte_code | [bytes](#bytes) | | WASMByteCode can be raw or gzip compressed | -| source | [string](#string) | | Source is a valid absolute HTTPS URI to the contract's source code, optional | -| builder | [string](#string) | | Builder is a valid docker image name with tag, optional | -| instantiate_permission | [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) | | InstantiatePermission access control to apply on contract creation, optional | - - - - - - - - -### MsgUpdateAdmin -MsgUpdateAdmin sets a new admin for a smart contract - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| sender | [string](#string) | | Sender is the that actor that signed the messages | -| new_admin | [string](#string) | | NewAdmin address to be set | -| contract | [string](#string) | | Contract is the address of the smart contract | - - - - - - - - - - - - - - -

Top

@@ -724,6 +600,130 @@ Query provides defines the gRPC querier service + +

Top

+ +## x/wasm/internal/types/tx.proto + + + + + +### MsgClearAdmin +MsgClearAdmin removes any admin stored for a smart contract + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| sender | [string](#string) | | Sender is the that actor that signed the messages | +| contract | [string](#string) | | Contract is the address of the smart contract | + + + + + + + + +### MsgExecuteContract +MsgExecuteContract submits the given message data to a smart contract + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| sender | [string](#string) | | Sender is the that actor that signed the messages | +| contract | [string](#string) | | Contract is the address of the smart contract | +| msg | [bytes](#bytes) | | Msg json encoded message to be passed to the contract | +| sent_funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | SentFunds coins that are transferred to the contract on execution | + + + + + + + + +### MsgInstantiateContract +MsgInstantiateContract create a new smart contract instance for the given code id. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| sender | [string](#string) | | Sender is the that actor that signed the messages | +| admin | [string](#string) | | Admin is an optional address that can execute migrations | +| code_id | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | +| label | [string](#string) | | Label is optional metadata to be stored with a contract instance. | +| init_msg | [bytes](#bytes) | | InitMsg json encoded message to be passed to the contract on instantiation | +| init_funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | InitFunds coins that are transferred to the contract on instantiation | + + + + + + + + +### MsgMigrateContract +MsgMigrateContract runs a code upgrade/ downgrade for a smart contract + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| sender | [string](#string) | | Sender is the that actor that signed the messages | +| contract | [string](#string) | | Contract is the address of the smart contract | +| code_id | [uint64](#uint64) | | CodeID references the new WASM code | +| migrate_msg | [bytes](#bytes) | | MigrateMsg json encoded message to be passed to the contract on migration | + + + + + + + + +### MsgStoreCode +MsgStoreCode submit Wasm code to the system + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| sender | [string](#string) | | Sender is the that actor that signed the messages | +| wasm_byte_code | [bytes](#bytes) | | WASMByteCode can be raw or gzip compressed | +| source | [string](#string) | | Source is a valid absolute HTTPS URI to the contract's source code, optional | +| builder | [string](#string) | | Builder is a valid docker image name with tag, optional | +| instantiate_permission | [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) | | InstantiatePermission access control to apply on contract creation, optional | + + + + + + + + +### MsgUpdateAdmin +MsgUpdateAdmin sets a new admin for a smart contract + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| sender | [string](#string) | | Sender is the that actor that signed the messages | +| new_admin | [string](#string) | | NewAdmin address to be set | +| contract | [string](#string) | | Contract is the address of the smart contract | + + + + + + + + + + + + + + +

Top

diff --git a/x/wasm/internal/types/genesis.pb.go b/x/wasm/internal/types/genesis.pb.go index 172d0061d4..067c8e5a64 100644 --- a/x/wasm/internal/types/genesis.pb.go +++ b/x/wasm/internal/types/genesis.pb.go @@ -100,7 +100,7 @@ func (m *GenesisState) GetGenMsgs() []GenesisState_GenMsgs { return nil } -// GenMsgs define the messages that can be executed during genesis phase. +// GenMsgs define the messages that can be executed during genesis phase in order. // The intention is to have more human readable data that is auditable. type GenesisState_GenMsgs struct { // sum is a single message @@ -390,47 +390,47 @@ func init() { } var fileDescriptor_52f9f2715025dba8 = []byte{ - // 639 bytes of a gzipped FileDescriptorProto + // 638 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x94, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0xe3, 0x26, 0x4e, 0x93, 0x6d, 0xa0, 0xd5, 0xb6, 0x88, 0x28, 0xa5, 0x71, 0x49, 0x2e, + 0x10, 0x86, 0xe3, 0x26, 0x4e, 0x93, 0x69, 0xa0, 0xd5, 0xb6, 0x88, 0x28, 0xa5, 0x4e, 0x49, 0x2e, 0xad, 0x80, 0x98, 0x96, 0x23, 0x27, 0xdc, 0x22, 0x9a, 0x56, 0x45, 0xc8, 0x95, 0x40, 0xea, 0x25, - 0x72, 0xec, 0xa9, 0xb1, 0xa8, 0xbd, 0x21, 0xb3, 0x29, 0xf5,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f, 0x50, 0x16, 0x50, 0xb1, 0x13, 0xc3, 0x3a, 0xbc, 0x9c, 0x1b, 0xda, 0xd5, + 0xdc, 0xd0, 0x7e, 0xcf, 0x0d, 0xed, 0xc7, 0xb5, 0x51, 0xba, 0xba, 0x36, 0x4a, 0xbf, 0xae, 0x8d, + 0xd2, 0xe9, 0x4b, 0x3f, 0xe0, 0x9f, 0x27, 0xc3, 0x9e, 0x4b, 0x43, 0x73, 0x8f, 0xb2, 0xf0, 0x93, + 0x78, 0xb9, 0x44, 0x6a, 0x9e, 0x39, 0x55, 0xbf, 0xb7, 0xdf, 0xb1, 0x61, 0x55, 0xbe, 0x62, 0xaf, + 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x65, 0x4f, 0x62, 0x92, 0x5c, 0x05, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/wasm/internal/types/genesis.proto b/x/wasm/internal/types/genesis.proto index 806a5b0915..1564306278 100644 --- a/x/wasm/internal/types/genesis.proto +++ b/x/wasm/internal/types/genesis.proto @@ -3,7 +3,7 @@ package cosmwasm.wasm.v1beta1; import "gogoproto/gogo.proto"; import "x/wasm/internal/types/types.proto"; -import "x/wasm/internal/types/msg.proto"; +import "x/wasm/internal/types/tx.proto"; option go_package = "github.com/CosmWasm/wasmd/x/wasmd/internal/types"; diff --git a/x/wasm/internal/types/msg.go b/x/wasm/internal/types/tx.go similarity index 100% rename from x/wasm/internal/types/msg.go rename to x/wasm/internal/types/tx.go diff --git a/x/wasm/internal/types/msg.pb.go b/x/wasm/internal/types/tx.pb.go similarity index 80% rename from x/wasm/internal/types/msg.pb.go rename to x/wasm/internal/types/tx.pb.go index a8c02b34c3..eaa8711299 100644 --- a/x/wasm/internal/types/msg.pb.go +++ b/x/wasm/internal/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: x/wasm/internal/types/msg.proto +// source: x/wasm/internal/types/tx.proto package types @@ -44,7 +44,7 @@ func (m *MsgStoreCode) Reset() { *m = MsgStoreCode{} } func (m *MsgStoreCode) String() string { return proto.CompactTextString(m) } func (*MsgStoreCode) ProtoMessage() {} func (*MsgStoreCode) Descriptor() ([]byte, []int) { - return fileDescriptor_22c4d58a052e9e95, []int{0} + return fileDescriptor_5129e02f2349864e, []int{0} } func (m *MsgStoreCode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -93,7 +93,7 @@ func (m *MsgInstantiateContract) Reset() { *m = MsgInstantiateContract{} func (m *MsgInstantiateContract) String() string { return proto.CompactTextString(m) } func (*MsgInstantiateContract) ProtoMessage() {} func (*MsgInstantiateContract) Descriptor() ([]byte, []int) { - return fileDescriptor_22c4d58a052e9e95, []int{1} + return fileDescriptor_5129e02f2349864e, []int{1} } func (m *MsgInstantiateContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -138,7 +138,7 @@ func (m *MsgExecuteContract) Reset() { *m = MsgExecuteContract{} } func (m *MsgExecuteContract) String() string { return proto.CompactTextString(m) } func (*MsgExecuteContract) ProtoMessage() {} func (*MsgExecuteContract) Descriptor() ([]byte, []int) { - return fileDescriptor_22c4d58a052e9e95, []int{2} + return fileDescriptor_5129e02f2349864e, []int{2} } func (m *MsgExecuteContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -183,7 +183,7 @@ func (m *MsgMigrateContract) Reset() { *m = MsgMigrateContract{} } func (m *MsgMigrateContract) String() string { return proto.CompactTextString(m) } func (*MsgMigrateContract) ProtoMessage() {} func (*MsgMigrateContract) Descriptor() ([]byte, []int) { - return fileDescriptor_22c4d58a052e9e95, []int{3} + return fileDescriptor_5129e02f2349864e, []int{3} } func (m *MsgMigrateContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -226,7 +226,7 @@ func (m *MsgUpdateAdmin) Reset() { *m = MsgUpdateAdmin{} } func (m *MsgUpdateAdmin) String() string { return proto.CompactTextString(m) } func (*MsgUpdateAdmin) ProtoMessage() {} func (*MsgUpdateAdmin) Descriptor() ([]byte, []int) { - return fileDescriptor_22c4d58a052e9e95, []int{4} + return fileDescriptor_5129e02f2349864e, []int{4} } func (m *MsgUpdateAdmin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -267,7 +267,7 @@ func (m *MsgClearAdmin) Reset() { *m = MsgClearAdmin{} } func (m *MsgClearAdmin) String() string { return proto.CompactTextString(m) } func (*MsgClearAdmin) ProtoMessage() {} func (*MsgClearAdmin) Descriptor() ([]byte, []int) { - return fileDescriptor_22c4d58a052e9e95, []int{5} + return fileDescriptor_5129e02f2349864e, []int{5} } func (m *MsgClearAdmin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,50 +305,50 @@ func init() { proto.RegisterType((*MsgClearAdmin)(nil), "cosmwasm.wasm.v1beta1.MsgClearAdmin") } -func init() { proto.RegisterFile("x/wasm/internal/types/msg.proto", fileDescriptor_22c4d58a052e9e95) } +func init() { proto.RegisterFile("x/wasm/internal/types/tx.proto", fileDescriptor_5129e02f2349864e) } -var fileDescriptor_22c4d58a052e9e95 = []byte{ - // 634 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0xc1, 0x6e, 0xd3, 0x4c, - 0x10, 0xc7, 0xe3, 0xa6, 0x4d, 0x9b, 0x6d, 0xbe, 0xea, 0x93, 0xd5, 0x56, 0xa6, 0x20, 0x27, 0xa4, - 0x97, 0x5c, 0xb0, 0xdb, 0x22, 0xc1, 0x89, 0x43, 0x63, 0x40, 0xea, 0xc1, 0x08, 0xb9, 0x42, 0x95, - 0x7a, 0x89, 0xd6, 0xf6, 0x74, 0xd9, 0x12, 0xef, 0x46, 0x9e, 0x0d, 0x69, 0xdf, 0x82, 0xa7, 0xe0, - 0x80, 0x78, 0x90, 0x1e, 0x7b, 0xe4, 0x14, 0x20, 0xe5, 0xc8, 0x13, 0x70, 0x42, 0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 0xa4, 0x16, 0x75, 0xf1, 0x3f, 0x05, 0x00, 0x00, +var fileDescriptor_5129e02f2349864e = []byte{ + // 632 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xe3, 0xa6, 0x4d, 0x9b, 0x6d, 0xa8, 0x90, 0xd5, 0x56, 0xa6, 0x20, 0x27, 0xa4, 0x97, + 0x5c, 0xb0, 0xdb, 0x22, 0xc1, 0x89, 0x43, 0x6d, 0x40, 0xea, 0xc1, 0x08, 0xb9, 0x42, 0x95, 0x7a, + 0xb1, 0xd6, 0xf6, 0x76, 0xd9, 0x12, 0xef, 0x46, 0x9e, 0x0d, 0x49, 0xdf, 0x82, 0xa7, 0xe0, 0x80, + 0x78, 0x90, 0x1e, 0x7b, 0xe4, 0x14, 0x20, 0xe5, 0xc8, 0x13, 0x70, 0x42, 0xbb, 0x76, 0x42, 0x2a, + 0x91, 0x2a, 0x12, 0xe2, 0x62, 0x67, 0x34, 0xff, 0xfc, 0x93, 0x6f, 0x76, 0xbc, 0xc8, 0x1e, 0xba, + 0x03, 0x0c, 0x99, 0xcb, 0xb8, 0x24, 0x39, 0xc7, 0x5d, 0x57, 0x5e, 0xf4, 0x08, 0xb8, 0x72, 0xe8, + 0xf4, 0x72, 0x21, 0x85, 0xb9, 0x95, 0x08, 0xc8, 0x94, 0xc2, 0xd1, 0x8f, 0xf7, 0xfb, 0x31, 0x91, + 0x78, 0x7f, 0x67, 0x93, 0x0a, 0x2a, 0xb4, 0xc2, 0x55, 0xbf, 0x0a, 0xf1, 0x8e, 0xad, 0xc4, 0x02, + 0xdc, 0x18, 0x03, 0x71, 0x4b, 0xa9, 0x9b, 0x08, 0xc6, 0xcb, 0xfc, 0xc3, 0x39, 0xcd, 0xd4, 0xb3, + 0x90, 0xb4, 0x7f, 0x1a, 0xa8, 0x11, 0x00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, 0x79, 0xff, 0xf4, 0x3e, 0xaa, 0x73, 0x32, 0x88, 0x66, 0x37, 0x77, 0x8d, + 0x93, 0x41, 0x51, 0x34, 0x8b, 0x51, 0xbd, 0x89, 0xd1, 0xf6, 0xd1, 0x9d, 0x00, 0xa8, 0xdf, 0x25, + 0x38, 0xbf, 0xbd, 0xc3, 0x2d, 0x26, 0xde, 0xab, 0xcb, 0xef, 0x76, 0xe5, 0x72, 0x6c, 0x1b, 0x57, + 0x63, 0xdb, 0xf8, 0x36, 0xb6, 0x8d, 0x0f, 0xd7, 0x76, 0xe5, 0xea, 0xda, 0xae, 0x7c, 0xb9, 0xb6, + 0x2b, 0xa7, 0x7b, 0x33, 0x27, 0xe5, 0x0b, 0xc8, 0x4e, 0xd4, 0x1d, 0xa5, 0x3e, 0xe5, 0xd4, 0x1d, + 0x96, 0xef, 0x9b, 0x37, 0x56, 0x5c, 0xd3, 0x97, 0xd5, 0xe3, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x7b, 0xfd, 0xe7, 0x34, 0x3e, 0x05, 0x00, 0x00, } func (m *MsgStoreCode) Marshal() (dAtA []byte, err error) { @@ -378,7 +378,7 @@ func (m *MsgStoreCode) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintMsg(dAtA, i, uint64(size)) + i = encodeVarintTx(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a @@ -386,28 +386,28 @@ func (m *MsgStoreCode) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Builder) > 0 { i -= len(m.Builder) copy(dAtA[i:], m.Builder) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Builder))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Builder))) i-- dAtA[i] = 0x22 } if len(m.Source) > 0 { i -= len(m.Source) copy(dAtA[i:], m.Source) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Source))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Source))) i-- dAtA[i] = 0x1a } if len(m.WASMByteCode) > 0 { i -= len(m.WASMByteCode) copy(dAtA[i:], m.WASMByteCode) - i = encodeVarintMsg(dAtA, i, uint64(len(m.WASMByteCode))) + i = encodeVarintTx(dAtA, i, uint64(len(m.WASMByteCode))) i-- dAtA[i] = 0x12 } if len(m.Sender) > 0 { i -= len(m.Sender) copy(dAtA[i:], m.Sender) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Sender))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) i-- dAtA[i] = 0xa } @@ -442,7 +442,7 @@ func (m *MsgInstantiateContract) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintMsg(dAtA, i, uint64(size)) + i = encodeVarintTx(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x32 @@ -451,33 +451,33 @@ func (m *MsgInstantiateContract) MarshalToSizedBuffer(dAtA []byte) (int, error) if len(m.InitMsg) > 0 { i -= len(m.InitMsg) copy(dAtA[i:], m.InitMsg) - i = encodeVarintMsg(dAtA, i, uint64(len(m.InitMsg))) + i = encodeVarintTx(dAtA, i, uint64(len(m.InitMsg))) i-- dAtA[i] = 0x2a } if len(m.Label) > 0 { i -= len(m.Label) copy(dAtA[i:], m.Label) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Label))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Label))) i-- dAtA[i] = 0x22 } if m.CodeID != 0 { - i = encodeVarintMsg(dAtA, i, uint64(m.CodeID)) + i = encodeVarintTx(dAtA, i, uint64(m.CodeID)) i-- dAtA[i] = 0x18 } if len(m.Admin) > 0 { i -= len(m.Admin) copy(dAtA[i:], m.Admin) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Admin))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Admin))) i-- dAtA[i] = 0x12 } if len(m.Sender) > 0 { i -= len(m.Sender) copy(dAtA[i:], m.Sender) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Sender))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) i-- dAtA[i] = 0xa } @@ -512,7 +512,7 @@ func (m *MsgExecuteContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintMsg(dAtA, i, uint64(size)) + i = encodeVarintTx(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a @@ -521,21 +521,21 @@ func (m *MsgExecuteContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Msg) > 0 { i -= len(m.Msg) copy(dAtA[i:], m.Msg) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Msg))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Msg))) i-- dAtA[i] = 0x1a } if len(m.Contract) > 0 { i -= len(m.Contract) copy(dAtA[i:], m.Contract) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Contract))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Contract))) i-- dAtA[i] = 0x12 } if len(m.Sender) > 0 { i -= len(m.Sender) copy(dAtA[i:], m.Sender) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Sender))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) i-- dAtA[i] = 0xa } @@ -565,26 +565,26 @@ func (m *MsgMigrateContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.MigrateMsg) > 0 { i -= len(m.MigrateMsg) copy(dAtA[i:], m.MigrateMsg) - i = encodeVarintMsg(dAtA, i, uint64(len(m.MigrateMsg))) + i = encodeVarintTx(dAtA, i, uint64(len(m.MigrateMsg))) i-- dAtA[i] = 0x22 } if m.CodeID != 0 { - i = encodeVarintMsg(dAtA, i, uint64(m.CodeID)) + i = encodeVarintTx(dAtA, i, uint64(m.CodeID)) i-- dAtA[i] = 0x18 } if len(m.Contract) > 0 { i -= len(m.Contract) copy(dAtA[i:], m.Contract) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Contract))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Contract))) i-- dAtA[i] = 0x12 } if len(m.Sender) > 0 { i -= len(m.Sender) copy(dAtA[i:], m.Sender) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Sender))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) i-- dAtA[i] = 0xa } @@ -614,21 +614,21 @@ func (m *MsgUpdateAdmin) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Contract) > 0 { i -= len(m.Contract) copy(dAtA[i:], m.Contract) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Contract))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Contract))) i-- dAtA[i] = 0x1a } if len(m.NewAdmin) > 0 { i -= len(m.NewAdmin) copy(dAtA[i:], m.NewAdmin) - i = encodeVarintMsg(dAtA, i, uint64(len(m.NewAdmin))) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewAdmin))) i-- dAtA[i] = 0x12 } if len(m.Sender) > 0 { i -= len(m.Sender) copy(dAtA[i:], m.Sender) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Sender))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) i-- dAtA[i] = 0xa } @@ -658,22 +658,22 @@ func (m *MsgClearAdmin) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Contract) > 0 { i -= len(m.Contract) copy(dAtA[i:], m.Contract) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Contract))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Contract))) i-- dAtA[i] = 0x1a } if len(m.Sender) > 0 { i -= len(m.Sender) copy(dAtA[i:], m.Sender) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Sender))) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarintMsg(dAtA []byte, offset int, v uint64) int { - offset -= sovMsg(v) +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -691,23 +691,23 @@ func (m *MsgStoreCode) Size() (n int) { _ = l l = len(m.Sender) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } l = len(m.WASMByteCode) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } l = len(m.Source) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } l = len(m.Builder) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } if m.InstantiatePermission != nil { l = m.InstantiatePermission.Size() - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } return n } @@ -720,27 +720,27 @@ func (m *MsgInstantiateContract) Size() (n int) { _ = l l = len(m.Sender) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } l = len(m.Admin) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } if m.CodeID != 0 { - n += 1 + sovMsg(uint64(m.CodeID)) + n += 1 + sovTx(uint64(m.CodeID)) } l = len(m.Label) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } l = len(m.InitMsg) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } if len(m.InitFunds) > 0 { for _, e := range m.InitFunds { l = e.Size() - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } } return n @@ -754,20 +754,20 @@ func (m *MsgExecuteContract) Size() (n int) { _ = l l = len(m.Sender) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } l = len(m.Contract) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } l = len(m.Msg) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } if len(m.SentFunds) > 0 { for _, e := range m.SentFunds { l = e.Size() - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } } return n @@ -781,18 +781,18 @@ func (m *MsgMigrateContract) Size() (n int) { _ = l l = len(m.Sender) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } l = len(m.Contract) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } if m.CodeID != 0 { - n += 1 + sovMsg(uint64(m.CodeID)) + n += 1 + sovTx(uint64(m.CodeID)) } l = len(m.MigrateMsg) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } return n } @@ -805,15 +805,15 @@ func (m *MsgUpdateAdmin) Size() (n int) { _ = l l = len(m.Sender) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } l = len(m.NewAdmin) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } l = len(m.Contract) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } return n } @@ -826,20 +826,20 @@ func (m *MsgClearAdmin) Size() (n int) { _ = l l = len(m.Sender) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } l = len(m.Contract) if l > 0 { - n += 1 + l + sovMsg(uint64(l)) + n += 1 + l + sovTx(uint64(l)) } return n } -func sovMsg(x uint64) (n int) { +func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } -func sozMsg(x uint64) (n int) { - return sovMsg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -849,7 +849,7 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -877,7 +877,7 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -891,11 +891,11 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -909,7 +909,7 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -922,11 +922,11 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -943,7 +943,7 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -957,11 +957,11 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -975,7 +975,7 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -989,11 +989,11 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1007,7 +1007,7 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1020,11 +1020,11 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1038,15 +1038,15 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipMsg(dAtA[iNdEx:]) + skippy, err := skipTx(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1068,7 +1068,7 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1096,7 +1096,7 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1110,11 +1110,11 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1128,7 +1128,7 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1142,11 +1142,11 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1160,7 +1160,7 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { m.CodeID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1179,7 +1179,7 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1193,11 +1193,11 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1211,7 +1211,7 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1224,11 +1224,11 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1245,7 +1245,7 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1258,11 +1258,11 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1274,15 +1274,15 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipMsg(dAtA[iNdEx:]) + skippy, err := skipTx(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1304,7 +1304,7 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1332,7 +1332,7 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1346,11 +1346,11 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1364,7 +1364,7 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1378,11 +1378,11 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1396,7 +1396,7 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1409,11 +1409,11 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1430,7 +1430,7 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1443,11 +1443,11 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1459,15 +1459,15 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipMsg(dAtA[iNdEx:]) + skippy, err := skipTx(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1489,7 +1489,7 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1517,7 +1517,7 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1531,11 +1531,11 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1549,7 +1549,7 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1563,11 +1563,11 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1581,7 +1581,7 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { m.CodeID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1600,7 +1600,7 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1613,11 +1613,11 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1629,15 +1629,15 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipMsg(dAtA[iNdEx:]) + skippy, err := skipTx(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1659,7 +1659,7 @@ func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1687,7 +1687,7 @@ func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1701,11 +1701,11 @@ func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1719,7 +1719,7 @@ func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1733,11 +1733,11 @@ func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1751,7 +1751,7 @@ func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1765,11 +1765,11 @@ func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1778,15 +1778,15 @@ func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipMsg(dAtA[iNdEx:]) + skippy, err := skipTx(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1808,7 +1808,7 @@ func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1836,7 +1836,7 @@ func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1850,11 +1850,11 @@ func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1868,7 +1868,7 @@ func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowMsg + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1882,11 +1882,11 @@ func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF @@ -1895,15 +1895,15 @@ func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipMsg(dAtA[iNdEx:]) + skippy, err := skipTx(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMsg + return ErrInvalidLengthTx } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1917,7 +1917,7 @@ func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error { } return nil } -func skipMsg(dAtA []byte) (n int, err error) { +func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 @@ -1925,7 +1925,7 @@ func skipMsg(dAtA []byte) (n int, err error) { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowMsg + return 0, ErrIntOverflowTx } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1942,7 +1942,7 @@ func skipMsg(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowMsg + return 0, ErrIntOverflowTx } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1958,7 +1958,7 @@ func skipMsg(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowMsg + return 0, ErrIntOverflowTx } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1971,14 +1971,14 @@ func skipMsg(dAtA []byte) (n int, err error) { } } if length < 0 { - return 0, ErrInvalidLengthMsg + return 0, ErrInvalidLengthTx } iNdEx += length case 3: depth++ case 4: if depth == 0 { - return 0, ErrUnexpectedEndOfGroupMsg + return 0, ErrUnexpectedEndOfGroupTx } depth-- case 5: @@ -1987,7 +1987,7 @@ func skipMsg(dAtA []byte) (n int, err error) { return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { - return 0, ErrInvalidLengthMsg + return 0, ErrInvalidLengthTx } if depth == 0 { return iNdEx, nil @@ -1997,7 +1997,7 @@ func skipMsg(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthMsg = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMsg = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupMsg = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") ) diff --git a/x/wasm/internal/types/msg.proto b/x/wasm/internal/types/tx.proto similarity index 100% rename from x/wasm/internal/types/msg.proto rename to x/wasm/internal/types/tx.proto diff --git a/x/wasm/internal/types/msg_test.go b/x/wasm/internal/types/tx_test.go similarity index 100% rename from x/wasm/internal/types/msg_test.go rename to x/wasm/internal/types/tx_test.go From c64d5d54ba6d9667e360a0180a9ea14a666f61a6 Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Fri, 8 Jan 2021 15:06:51 +0100 Subject: [PATCH 2/7] Refactor to grpc message server --- doc/proto.md | 103 ++ x/wasm/alias.go | 61 +- x/wasm/genesis_test.go | 12 +- x/wasm/handler.go | 215 +--- x/wasm/internal/keeper/msg_server.go | 185 +++ x/wasm/internal/types/codec.go | 3 + x/wasm/internal/types/tx.pb.go | 1723 ++++++++++++++++++++++---- x/wasm/internal/types/tx.proto | 140 ++- x/wasm/module.go | 5 +- x/wasm/module_test.go | 30 +- 10 files changed, 1955 insertions(+), 522 deletions(-) create mode 100644 x/wasm/internal/keeper/msg_server.go diff --git a/doc/proto.md b/doc/proto.md index 7cce573d76..571fe8d60e 100644 --- a/doc/proto.md +++ b/doc/proto.md @@ -41,11 +41,19 @@ - [x/wasm/internal/types/tx.proto](#x/wasm/internal/types/tx.proto) - [MsgClearAdmin](#cosmwasm.wasm.v1beta1.MsgClearAdmin) + - [MsgClearAdminResponse](#cosmwasm.wasm.v1beta1.MsgClearAdminResponse) - [MsgExecuteContract](#cosmwasm.wasm.v1beta1.MsgExecuteContract) + - [MsgExecuteContractResponse](#cosmwasm.wasm.v1beta1.MsgExecuteContractResponse) - [MsgInstantiateContract](#cosmwasm.wasm.v1beta1.MsgInstantiateContract) + - [MsgInstantiateContractResponse](#cosmwasm.wasm.v1beta1.MsgInstantiateContractResponse) - [MsgMigrateContract](#cosmwasm.wasm.v1beta1.MsgMigrateContract) + - [MsgMigrateContractResponse](#cosmwasm.wasm.v1beta1.MsgMigrateContractResponse) - [MsgStoreCode](#cosmwasm.wasm.v1beta1.MsgStoreCode) + - [MsgStoreCodeResponse](#cosmwasm.wasm.v1beta1.MsgStoreCodeResponse) - [MsgUpdateAdmin](#cosmwasm.wasm.v1beta1.MsgUpdateAdmin) + - [MsgUpdateAdminResponse](#cosmwasm.wasm.v1beta1.MsgUpdateAdminResponse) + + - [Msg](#cosmwasm.wasm.v1beta1.Msg) - [x/wasm/internal/types/types.proto](#x/wasm/internal/types/types.proto) - [AbsoluteTxPosition](#cosmwasm.wasm.v1beta1.AbsoluteTxPosition) @@ -623,6 +631,16 @@ MsgClearAdmin removes any admin stored for a smart contract + + +### MsgClearAdminResponse +MsgClearAdminResponse returns empty data + + + + + + ### MsgExecuteContract @@ -641,6 +659,21 @@ MsgExecuteContract submits the given message data to a smart contract + + +### MsgExecuteContractResponse +MsgExecuteContractResponse returns execution result data. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| data | [bytes](#bytes) | | Data contains base64-encoded bytes to returned from the contract | + + + + + + ### MsgInstantiateContract @@ -661,6 +694,21 @@ MsgInstantiateContract create a new smart contract instance for the given code i + + +### MsgInstantiateContractResponse +MsgInstantiateContractResponse return instantiation result data + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| address | [string](#string) | | Address is the address of the new contract instance. | + + + + + + ### MsgMigrateContract @@ -679,6 +727,21 @@ MsgMigrateContract runs a code upgrade/ downgrade for a smart contract + + +### MsgMigrateContractResponse +MsgMigrateContractResponse returns contract migration result data. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| data | [bytes](#bytes) | | Data contains base64-encoded bytes returned from the wasm contract. | + + + + + + ### MsgStoreCode @@ -698,6 +761,21 @@ MsgStoreCode submit Wasm code to the system + + +### MsgStoreCodeResponse +MsgStoreCodeResponse returns store result data. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| code_id | [string](#string) | | CodeID is the reference to the stored WASM code | + + + + + + ### MsgUpdateAdmin @@ -714,12 +792,37 @@ MsgUpdateAdmin sets a new admin for a smart contract + + + +### MsgUpdateAdminResponse +MsgUpdateAdminResponse returns empty data + + + + + + + + +### Msg +Msg defines the wasm Msg service. + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| StoreCode | [MsgStoreCode](#cosmwasm.wasm.v1beta1.MsgStoreCode) | [MsgStoreCodeResponse](#cosmwasm.wasm.v1beta1.MsgStoreCodeResponse) | StoreCode to submit Wasm code to the system | +| InstantiateContract | [MsgInstantiateContract](#cosmwasm.wasm.v1beta1.MsgInstantiateContract) | [MsgInstantiateContractResponse](#cosmwasm.wasm.v1beta1.MsgInstantiateContractResponse) | Instantiate creates a new smart contract instance for the given code id. | +| ExecuteContract | [MsgExecuteContract](#cosmwasm.wasm.v1beta1.MsgExecuteContract) | [MsgExecuteContractResponse](#cosmwasm.wasm.v1beta1.MsgExecuteContractResponse) | Execute submits the given message data to a smart contract | +| MigrateContract | [MsgMigrateContract](#cosmwasm.wasm.v1beta1.MsgMigrateContract) | [MsgMigrateContractResponse](#cosmwasm.wasm.v1beta1.MsgMigrateContractResponse) | Migrate runs a code upgrade/ downgrade for a smart contract | +| UpdateAdmin | [MsgUpdateAdmin](#cosmwasm.wasm.v1beta1.MsgUpdateAdmin) | [MsgUpdateAdminResponse](#cosmwasm.wasm.v1beta1.MsgUpdateAdminResponse) | UpdateAdmin sets a new admin for a smart contract | +| ClearAdmin | [MsgClearAdmin](#cosmwasm.wasm.v1beta1.MsgClearAdmin) | [MsgClearAdminResponse](#cosmwasm.wasm.v1beta1.MsgClearAdminResponse) | ClearAdmin removes any admin stored for a smart contract | + diff --git a/x/wasm/alias.go b/x/wasm/alias.go index c52a70cfe6..bd22f274d8 100644 --- a/x/wasm/alias.go +++ b/x/wasm/alias.go @@ -100,31 +100,38 @@ var ( ) type ( - ProposalType = types.ProposalType - GenesisState = types.GenesisState - Code = types.Code - Contract = types.Contract - MsgStoreCode = types.MsgStoreCode - MsgInstantiateContract = types.MsgInstantiateContract - MsgExecuteContract = types.MsgExecuteContract - MsgMigrateContract = types.MsgMigrateContract - MsgUpdateAdmin = types.MsgUpdateAdmin - MsgClearAdmin = types.MsgClearAdmin - Model = types.Model - CodeInfo = types.CodeInfo - ContractInfo = types.ContractInfo - CreatedAt = types.AbsoluteTxPosition - Config = types.WasmConfig - ContractInfoWithAddress = types.ContractInfoWithAddress - CodeInfoResponse = types.CodeInfoResponse - MessageHandler = keeper.MessageHandler - BankEncoder = keeper.BankEncoder - CustomEncoder = keeper.CustomEncoder - StakingEncoder = keeper.StakingEncoder - WasmEncoder = keeper.WasmEncoder - MessageEncoders = keeper.MessageEncoders - Keeper = keeper.Keeper - QueryHandler = keeper.QueryHandler - CustomQuerier = keeper.CustomQuerier - QueryPlugins = keeper.QueryPlugins + ProposalType = types.ProposalType + GenesisState = types.GenesisState + Code = types.Code + Contract = types.Contract + MsgStoreCode = types.MsgStoreCode + MsgStoreCodeResponse = types.MsgStoreCodeResponse + MsgInstantiateContract = types.MsgInstantiateContract + MsgInstantiateContractResponse = types.MsgInstantiateContractResponse + MsgExecuteContract = types.MsgExecuteContract + MsgExecuteContractResponse = types.MsgExecuteContractResponse + MsgMigrateContract = types.MsgMigrateContract + MsgMigrateContractResponse = types.MsgMigrateContractResponse + MsgUpdateAdmin = types.MsgUpdateAdmin + MsgUpdateAdminResponse = types.MsgUpdateAdminResponse + MsgClearAdmin = types.MsgClearAdmin + MsgClearAdminResponse = types.MsgClearAdminResponse + MsgServer = types.MsgServer + Model = types.Model + CodeInfo = types.CodeInfo + ContractInfo = types.ContractInfo + CreatedAt = types.AbsoluteTxPosition + Config = types.WasmConfig + ContractInfoWithAddress = types.ContractInfoWithAddress + CodeInfoResponse = types.CodeInfoResponse + MessageHandler = keeper.MessageHandler + BankEncoder = keeper.BankEncoder + CustomEncoder = keeper.CustomEncoder + StakingEncoder = keeper.StakingEncoder + WasmEncoder = keeper.WasmEncoder + MessageEncoders = keeper.MessageEncoders + Keeper = keeper.Keeper + QueryHandler = keeper.QueryHandler + CustomQuerier = keeper.CustomQuerier + QueryPlugins = keeper.QueryPlugins ) diff --git a/x/wasm/genesis_test.go b/x/wasm/genesis_test.go index 8bb6f9cd4a..e40d50b86d 100644 --- a/x/wasm/genesis_test.go +++ b/x/wasm/genesis_test.go @@ -30,7 +30,10 @@ func TestInitGenesis(t *testing.T) { res, err := h(data.ctx, &msg) require.NoError(t, err) - require.Equal(t, res.Data, []byte("1")) + + var pStoreResp MsgStoreCodeResponse + require.NoError(t, pStoreResp.Unmarshal(res.Data)) + require.Equal(t, pStoreResp.CodeID, "1") _, _, bob := keyPubAddr() initMsg := initMsg{ @@ -48,7 +51,9 @@ func TestInitGenesis(t *testing.T) { } res, err = h(data.ctx, &initCmd) require.NoError(t, err) - contractBech32Addr := string(res.Data) + var pInstResp MsgInstantiateContractResponse + require.NoError(t, pInstResp.Unmarshal(res.Data)) + contractBech32Addr := pInstResp.Address execCmd := MsgExecuteContract{ Sender: fred.String(), @@ -58,6 +63,9 @@ func TestInitGenesis(t *testing.T) { } res, err = h(data.ctx, &execCmd) require.NoError(t, err) + var pExecResp MsgExecuteContractResponse + require.NoError(t, pExecResp.Unmarshal(res.Data)) + require.NotEmpty(t, pExecResp.Data) // ensure all contract state is as after init assertCodeList(t, q, data.ctx, 1) diff --git a/x/wasm/handler.go b/x/wasm/handler.go index 67f38277ab..4ef66bcd3d 100644 --- a/x/wasm/handler.go +++ b/x/wasm/handler.go @@ -2,215 +2,70 @@ package wasm import ( "fmt" - + "github.com/CosmWasm/wasmd/x/wasm/internal/keeper" "github.com/CosmWasm/wasmd/x/wasm/internal/types" + "github.com/gogo/protobuf/proto" + abci "github.com/tendermint/tendermint/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - abci "github.com/tendermint/tendermint/abci/types" ) // NewHandler returns a handler for "bank" type messages. func NewHandler(k *Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) + var ( + res proto.Message + err error + ) switch msg := msg.(type) { case *MsgStoreCode: - return handleStoreCode(ctx, k, msg) + res, err = msgServer.StoreCode(sdk.WrapSDKContext(ctx), msg) case *MsgInstantiateContract: - return handleInstantiate(ctx, k, msg) + res, err = msgServer.InstantiateContract(sdk.WrapSDKContext(ctx), msg) case *MsgExecuteContract: - return handleExecute(ctx, k, msg) + res, err = msgServer.ExecuteContract(sdk.WrapSDKContext(ctx), msg) case *MsgMigrateContract: - return handleMigration(ctx, k, msg) + res, err = msgServer.MigrateContract(sdk.WrapSDKContext(ctx), msg) case *MsgUpdateAdmin: - return handleUpdateContractAdmin(ctx, k, msg) + res, err = msgServer.UpdateAdmin(sdk.WrapSDKContext(ctx), msg) case *MsgClearAdmin: - return handleClearContractAdmin(ctx, k, msg) + res, err = msgServer.ClearAdmin(sdk.WrapSDKContext(ctx), msg) default: errMsg := fmt.Sprintf("unrecognized wasm message type: %T", msg) return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) } + + ctx = ctx.WithEventManager(filterMessageEvents(ctx)) + return sdk.WrapServiceResult(ctx, res, err) } } -// filterMessageEvents returns the same events with all of type == EventTypeMessage removed. +// filterMessageEvents returns the same events with all of type == EventTypeMessage removed except +// for wasm message types. // this is so only our top-level message event comes through -func filteredMessageEvents(manager *sdk.EventManager) []abci.Event { - events := manager.ABCIEvents() - res := make([]abci.Event, 0, len(events)) - for _, e := range events { - if e.Type != sdk.EventTypeMessage { - res = append(res, e) +func filterMessageEvents(ctx sdk.Context) *sdk.EventManager { + m := sdk.NewEventManager() + for _, e := range ctx.EventManager().Events() { + if e.Type == sdk.EventTypeMessage && + !hasWasmModuleAttribute(e.Attributes) { + continue } + m.EmitEvent(e) } - return res -} - -func handleStoreCode(ctx sdk.Context, k *Keeper, msg *MsgStoreCode) (*sdk.Result, error) { - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, sdkerrors.Wrap(err, "sender") - } - codeID, err := k.Create(ctx, senderAddr, msg.WASMByteCode, msg.Source, msg.Builder, msg.InstantiatePermission) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, ModuleName), - sdk.NewAttribute(types.AttributeKeySigner, msg.Sender), - sdk.NewAttribute(types.AttributeKeyCodeID, fmt.Sprintf("%d", codeID)), - ), - }) - - return &sdk.Result{ - Data: []byte(fmt.Sprintf("%d", codeID)), - Events: ctx.EventManager().ABCIEvents(), - }, nil + return m } -func handleInstantiate(ctx sdk.Context, k *Keeper, msg *MsgInstantiateContract) (*sdk.Result, error) { - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, sdkerrors.Wrap(err, "sender") - } - var adminAddr sdk.AccAddress - if msg.Admin != "" { - if adminAddr, err = sdk.AccAddressFromBech32(msg.Admin); err != nil { - return nil, sdkerrors.Wrap(err, "admin") +func hasWasmModuleAttribute(attrs []abci.EventAttribute) bool { + for _, a := range attrs { + if sdk.AttributeKeyModule == string(a.Key) && + types.ModuleName == string(a.Value) { + return true } } - - contractAddr, err := k.Instantiate(ctx, msg.CodeID, senderAddr, adminAddr, msg.InitMsg, msg.Label, msg.InitFunds) - if err != nil { - return nil, err - } - - events := filteredMessageEvents(ctx.EventManager()) - custom := sdk.Events{sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, ModuleName), - sdk.NewAttribute(types.AttributeKeySigner, msg.Sender), - sdk.NewAttribute(types.AttributeKeyCodeID, fmt.Sprintf("%d", msg.CodeID)), - sdk.NewAttribute(types.AttributeKeyContract, contractAddr.String()), - )} - events = append(events, custom.ToABCIEvents()...) - - return &sdk.Result{ - Data: []byte(contractAddr.String()), - Events: events, - }, nil -} - -func handleExecute(ctx sdk.Context, k *Keeper, msg *MsgExecuteContract) (*sdk.Result, error) { - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, sdkerrors.Wrap(err, "sender") - } - contractAddr, err := sdk.AccAddressFromBech32(msg.Contract) - if err != nil { - return nil, sdkerrors.Wrap(err, "contract") - } - - res, err := k.Execute(ctx, contractAddr, senderAddr, msg.Msg, msg.SentFunds) - if err != nil { - return nil, err - } - - events := filteredMessageEvents(ctx.EventManager()) - custom := sdk.Events{sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, ModuleName), - sdk.NewAttribute(types.AttributeKeySigner, msg.Sender), - sdk.NewAttribute(types.AttributeKeyContract, msg.Contract), - ), - } - events = append(events, custom.ToABCIEvents()...) - - res.Events = events - return res, nil -} - -func handleMigration(ctx sdk.Context, k *Keeper, msg *MsgMigrateContract) (*sdk.Result, error) { - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, sdkerrors.Wrap(err, "sender") - } - contractAddr, err := sdk.AccAddressFromBech32(msg.Contract) - if err != nil { - return nil, sdkerrors.Wrap(err, "contract") - } - - res, err := k.Migrate(ctx, contractAddr, senderAddr, msg.CodeID, msg.MigrateMsg) - if err != nil { - return nil, err - } - - events := filteredMessageEvents(ctx.EventManager()) - custom := sdk.Events{sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, ModuleName), - sdk.NewAttribute(types.AttributeKeySigner, msg.Sender), - sdk.NewAttribute(types.AttributeKeyContract, msg.Contract), - )} - events = append(events, custom.ToABCIEvents()...) - res.Events = events - return res, nil -} - -func handleUpdateContractAdmin(ctx sdk.Context, k *Keeper, msg *MsgUpdateAdmin) (*sdk.Result, error) { - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, sdkerrors.Wrap(err, "sender") - } - contractAddr, err := sdk.AccAddressFromBech32(msg.Contract) - if err != nil { - return nil, sdkerrors.Wrap(err, "contract") - } - newAdminAddr, err := sdk.AccAddressFromBech32(msg.NewAdmin) - if err != nil { - return nil, sdkerrors.Wrap(err, "new admin") - } - - if err := k.UpdateContractAdmin(ctx, contractAddr, senderAddr, newAdminAddr); err != nil { - return nil, err - } - events := ctx.EventManager().Events() - ourEvent := sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, ModuleName), - sdk.NewAttribute(types.AttributeKeySigner, msg.Sender), - sdk.NewAttribute(types.AttributeKeyContract, msg.Contract), - ) - return &sdk.Result{ - Events: append(events, ourEvent).ToABCIEvents(), - }, nil -} - -func handleClearContractAdmin(ctx sdk.Context, k *Keeper, msg *MsgClearAdmin) (*sdk.Result, error) { - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, sdkerrors.Wrap(err, "sender") - } - contractAddr, err := sdk.AccAddressFromBech32(msg.Contract) - if err != nil { - return nil, sdkerrors.Wrap(err, "contract") - } - - if err := k.ClearContractAdmin(ctx, contractAddr, senderAddr); err != nil { - return nil, err - } - events := ctx.EventManager().Events() - ourEvent := sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, ModuleName), - sdk.NewAttribute(types.AttributeKeySigner, msg.Sender), - sdk.NewAttribute(types.AttributeKeyContract, msg.Contract), - ) - return &sdk.Result{ - Events: append(events, ourEvent).ToABCIEvents(), - }, nil + return false } diff --git a/x/wasm/internal/keeper/msg_server.go b/x/wasm/internal/keeper/msg_server.go new file mode 100644 index 0000000000..8c33cf6f34 --- /dev/null +++ b/x/wasm/internal/keeper/msg_server.go @@ -0,0 +1,185 @@ +package keeper + +import ( + "context" + "fmt" + "github.com/CosmWasm/wasmd/x/wasm/internal/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ types.MsgServer = msgServer{} + +type msgServer struct { + keeper *Keeper +} + +func NewMsgServerImpl(k *Keeper) types.MsgServer { + return &msgServer{keeper: k} +} + +func (m msgServer) StoreCode(goCtx context.Context, msg *types.MsgStoreCode) (*types.MsgStoreCodeResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, sdkerrors.Wrap(err, "sender") + } + codeID, err := m.keeper.Create(ctx, senderAddr, msg.WASMByteCode, msg.Source, msg.Builder, msg.InstantiatePermission) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(types.AttributeKeySigner, msg.Sender), + sdk.NewAttribute(types.AttributeKeyCodeID, fmt.Sprintf("%d", codeID)), + )) + + return &types.MsgStoreCodeResponse{ + CodeID: fmt.Sprintf("%d", codeID), + }, nil +} + +func (m msgServer) InstantiateContract(goCtx context.Context, msg *types.MsgInstantiateContract) (*types.MsgInstantiateContractResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, sdkerrors.Wrap(err, "sender") + } + var adminAddr sdk.AccAddress + if msg.Admin != "" { + if adminAddr, err = sdk.AccAddressFromBech32(msg.Admin); err != nil { + return nil, sdkerrors.Wrap(err, "admin") + } + } + + contractAddr, err := m.keeper.Instantiate(ctx, msg.CodeID, senderAddr, adminAddr, msg.InitMsg, msg.Label, msg.InitFunds) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(types.AttributeKeySigner, msg.Sender), + sdk.NewAttribute(types.AttributeKeyCodeID, fmt.Sprintf("%d", msg.CodeID)), + sdk.NewAttribute(types.AttributeKeyContract, contractAddr.String()), + )) + + return &types.MsgInstantiateContractResponse{ + Address: contractAddr.String(), + }, nil +} + +func (m msgServer) ExecuteContract(goCtx context.Context, msg *types.MsgExecuteContract) (*types.MsgExecuteContractResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, sdkerrors.Wrap(err, "sender") + } + contractAddr, err := sdk.AccAddressFromBech32(msg.Contract) + if err != nil { + return nil, sdkerrors.Wrap(err, "contract") + } + + res, err := m.keeper.Execute(ctx, contractAddr, senderAddr, msg.Msg, msg.SentFunds) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(types.AttributeKeySigner, msg.Sender), + sdk.NewAttribute(types.AttributeKeyContract, msg.Contract), + )) + + return &types.MsgExecuteContractResponse{ + Data: res.Data, + }, nil + +} + +func (m msgServer) MigrateContract(goCtx context.Context, msg *types.MsgMigrateContract) (*types.MsgMigrateContractResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, sdkerrors.Wrap(err, "sender") + } + contractAddr, err := sdk.AccAddressFromBech32(msg.Contract) + if err != nil { + return nil, sdkerrors.Wrap(err, "contract") + } + + res, err := m.keeper.Migrate(ctx, contractAddr, senderAddr, msg.CodeID, msg.MigrateMsg) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(types.AttributeKeySigner, msg.Sender), + sdk.NewAttribute(types.AttributeKeyContract, msg.Contract), + )) + + return &types.MsgMigrateContractResponse{ + Data: res.Data, + }, nil +} + +func (m msgServer) UpdateAdmin(goCtx context.Context, msg *types.MsgUpdateAdmin) (*types.MsgUpdateAdminResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, sdkerrors.Wrap(err, "sender") + } + contractAddr, err := sdk.AccAddressFromBech32(msg.Contract) + if err != nil { + return nil, sdkerrors.Wrap(err, "contract") + } + newAdminAddr, err := sdk.AccAddressFromBech32(msg.NewAdmin) + if err != nil { + return nil, sdkerrors.Wrap(err, "new admin") + } + + if err := m.keeper.UpdateContractAdmin(ctx, contractAddr, senderAddr, newAdminAddr); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(types.AttributeKeySigner, msg.Sender), + sdk.NewAttribute(types.AttributeKeyContract, msg.Contract), + )) + + return &types.MsgUpdateAdminResponse{}, nil +} + +func (m msgServer) ClearAdmin(goCtx context.Context, msg *types.MsgClearAdmin) (*types.MsgClearAdminResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, sdkerrors.Wrap(err, "sender") + } + contractAddr, err := sdk.AccAddressFromBech32(msg.Contract) + if err != nil { + return nil, sdkerrors.Wrap(err, "contract") + } + + if err := m.keeper.ClearContractAdmin(ctx, contractAddr, senderAddr); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(types.AttributeKeySigner, msg.Sender), + sdk.NewAttribute(types.AttributeKeyContract, msg.Contract), + )) + + return &types.MsgClearAdminResponse{}, nil +} diff --git a/x/wasm/internal/types/codec.go b/x/wasm/internal/types/codec.go index 0015caf587..c8b3aef2d4 100644 --- a/x/wasm/internal/types/codec.go +++ b/x/wasm/internal/types/codec.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -42,6 +43,8 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &UpdateAdminProposal{}, &ClearAdminProposal{}, ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } var ( diff --git a/x/wasm/internal/types/tx.pb.go b/x/wasm/internal/types/tx.pb.go index eaa8711299..2a9eea1893 100644 --- a/x/wasm/internal/types/tx.pb.go +++ b/x/wasm/internal/types/tx.pb.go @@ -4,12 +4,17 @@ package types import ( + context "context" encoding_json "encoding/json" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -73,6 +78,45 @@ func (m *MsgStoreCode) XXX_DiscardUnknown() { var xxx_messageInfo_MsgStoreCode proto.InternalMessageInfo +// MsgStoreCodeResponse returns store result data. +type MsgStoreCodeResponse struct { + // CodeID is the reference to the stored WASM code + CodeID string `protobuf:"bytes,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` +} + +func (m *MsgStoreCodeResponse) Reset() { *m = MsgStoreCodeResponse{} } +func (m *MsgStoreCodeResponse) String() string { return proto.CompactTextString(m) } +func (*MsgStoreCodeResponse) ProtoMessage() {} +func (*MsgStoreCodeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5129e02f2349864e, []int{1} +} +func (m *MsgStoreCodeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgStoreCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgStoreCodeResponse.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 *MsgStoreCodeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgStoreCodeResponse.Merge(m, src) +} +func (m *MsgStoreCodeResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgStoreCodeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgStoreCodeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgStoreCodeResponse proto.InternalMessageInfo + // MsgInstantiateContract create a new smart contract instance for the given code id. type MsgInstantiateContract struct { // Sender is the that actor that signed the messages @@ -93,7 +137,7 @@ func (m *MsgInstantiateContract) Reset() { *m = MsgInstantiateContract{} func (m *MsgInstantiateContract) String() string { return proto.CompactTextString(m) } func (*MsgInstantiateContract) ProtoMessage() {} func (*MsgInstantiateContract) Descriptor() ([]byte, []int) { - return fileDescriptor_5129e02f2349864e, []int{1} + return fileDescriptor_5129e02f2349864e, []int{2} } func (m *MsgInstantiateContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -122,6 +166,45 @@ func (m *MsgInstantiateContract) XXX_DiscardUnknown() { var xxx_messageInfo_MsgInstantiateContract proto.InternalMessageInfo +// MsgInstantiateContractResponse return instantiation result data +type MsgInstantiateContractResponse struct { + // Address is the address of the new contract instance. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgInstantiateContractResponse) Reset() { *m = MsgInstantiateContractResponse{} } +func (m *MsgInstantiateContractResponse) String() string { return proto.CompactTextString(m) } +func (*MsgInstantiateContractResponse) ProtoMessage() {} +func (*MsgInstantiateContractResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5129e02f2349864e, []int{3} +} +func (m *MsgInstantiateContractResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgInstantiateContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgInstantiateContractResponse.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 *MsgInstantiateContractResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgInstantiateContractResponse.Merge(m, src) +} +func (m *MsgInstantiateContractResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgInstantiateContractResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgInstantiateContractResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgInstantiateContractResponse proto.InternalMessageInfo + // MsgExecuteContract submits the given message data to a smart contract type MsgExecuteContract struct { // Sender is the that actor that signed the messages @@ -138,7 +221,7 @@ func (m *MsgExecuteContract) Reset() { *m = MsgExecuteContract{} } func (m *MsgExecuteContract) String() string { return proto.CompactTextString(m) } func (*MsgExecuteContract) ProtoMessage() {} func (*MsgExecuteContract) Descriptor() ([]byte, []int) { - return fileDescriptor_5129e02f2349864e, []int{2} + return fileDescriptor_5129e02f2349864e, []int{4} } func (m *MsgExecuteContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -167,6 +250,45 @@ func (m *MsgExecuteContract) XXX_DiscardUnknown() { var xxx_messageInfo_MsgExecuteContract proto.InternalMessageInfo +// MsgExecuteContractResponse returns execution result data. +type MsgExecuteContractResponse struct { + // Data contains base64-encoded bytes to returned from the contract + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *MsgExecuteContractResponse) Reset() { *m = MsgExecuteContractResponse{} } +func (m *MsgExecuteContractResponse) String() string { return proto.CompactTextString(m) } +func (*MsgExecuteContractResponse) ProtoMessage() {} +func (*MsgExecuteContractResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5129e02f2349864e, []int{5} +} +func (m *MsgExecuteContractResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecuteContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecuteContractResponse.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 *MsgExecuteContractResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecuteContractResponse.Merge(m, src) +} +func (m *MsgExecuteContractResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgExecuteContractResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecuteContractResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecuteContractResponse proto.InternalMessageInfo + // MsgMigrateContract runs a code upgrade/ downgrade for a smart contract type MsgMigrateContract struct { // Sender is the that actor that signed the messages @@ -183,7 +305,7 @@ func (m *MsgMigrateContract) Reset() { *m = MsgMigrateContract{} } func (m *MsgMigrateContract) String() string { return proto.CompactTextString(m) } func (*MsgMigrateContract) ProtoMessage() {} func (*MsgMigrateContract) Descriptor() ([]byte, []int) { - return fileDescriptor_5129e02f2349864e, []int{3} + return fileDescriptor_5129e02f2349864e, []int{6} } func (m *MsgMigrateContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -212,6 +334,45 @@ func (m *MsgMigrateContract) XXX_DiscardUnknown() { var xxx_messageInfo_MsgMigrateContract proto.InternalMessageInfo +// MsgMigrateContractResponse returns contract migration result data. +type MsgMigrateContractResponse struct { + // Data contains base64-encoded bytes returned from the wasm contract. + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *MsgMigrateContractResponse) Reset() { *m = MsgMigrateContractResponse{} } +func (m *MsgMigrateContractResponse) String() string { return proto.CompactTextString(m) } +func (*MsgMigrateContractResponse) ProtoMessage() {} +func (*MsgMigrateContractResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5129e02f2349864e, []int{7} +} +func (m *MsgMigrateContractResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMigrateContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMigrateContractResponse.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 *MsgMigrateContractResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMigrateContractResponse.Merge(m, src) +} +func (m *MsgMigrateContractResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgMigrateContractResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMigrateContractResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMigrateContractResponse proto.InternalMessageInfo + // MsgUpdateAdmin sets a new admin for a smart contract type MsgUpdateAdmin struct { // Sender is the that actor that signed the messages @@ -226,7 +387,7 @@ func (m *MsgUpdateAdmin) Reset() { *m = MsgUpdateAdmin{} } func (m *MsgUpdateAdmin) String() string { return proto.CompactTextString(m) } func (*MsgUpdateAdmin) ProtoMessage() {} func (*MsgUpdateAdmin) Descriptor() ([]byte, []int) { - return fileDescriptor_5129e02f2349864e, []int{4} + return fileDescriptor_5129e02f2349864e, []int{8} } func (m *MsgUpdateAdmin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -255,6 +416,43 @@ func (m *MsgUpdateAdmin) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateAdmin proto.InternalMessageInfo +// MsgUpdateAdminResponse returns empty data +type MsgUpdateAdminResponse struct { +} + +func (m *MsgUpdateAdminResponse) Reset() { *m = MsgUpdateAdminResponse{} } +func (m *MsgUpdateAdminResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateAdminResponse) ProtoMessage() {} +func (*MsgUpdateAdminResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5129e02f2349864e, []int{9} +} +func (m *MsgUpdateAdminResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateAdminResponse.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 *MsgUpdateAdminResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateAdminResponse.Merge(m, src) +} +func (m *MsgUpdateAdminResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateAdminResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateAdminResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateAdminResponse proto.InternalMessageInfo + // MsgClearAdmin removes any admin stored for a smart contract type MsgClearAdmin struct { // Sender is the that actor that signed the messages @@ -267,7 +465,7 @@ func (m *MsgClearAdmin) Reset() { *m = MsgClearAdmin{} } func (m *MsgClearAdmin) String() string { return proto.CompactTextString(m) } func (*MsgClearAdmin) ProtoMessage() {} func (*MsgClearAdmin) Descriptor() ([]byte, []int) { - return fileDescriptor_5129e02f2349864e, []int{5} + return fileDescriptor_5129e02f2349864e, []int{10} } func (m *MsgClearAdmin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -296,59 +494,386 @@ func (m *MsgClearAdmin) XXX_DiscardUnknown() { var xxx_messageInfo_MsgClearAdmin proto.InternalMessageInfo +// MsgClearAdminResponse returns empty data +type MsgClearAdminResponse struct { +} + +func (m *MsgClearAdminResponse) Reset() { *m = MsgClearAdminResponse{} } +func (m *MsgClearAdminResponse) String() string { return proto.CompactTextString(m) } +func (*MsgClearAdminResponse) ProtoMessage() {} +func (*MsgClearAdminResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5129e02f2349864e, []int{11} +} +func (m *MsgClearAdminResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClearAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClearAdminResponse.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 *MsgClearAdminResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClearAdminResponse.Merge(m, src) +} +func (m *MsgClearAdminResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgClearAdminResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClearAdminResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClearAdminResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgStoreCode)(nil), "cosmwasm.wasm.v1beta1.MsgStoreCode") + proto.RegisterType((*MsgStoreCodeResponse)(nil), "cosmwasm.wasm.v1beta1.MsgStoreCodeResponse") proto.RegisterType((*MsgInstantiateContract)(nil), "cosmwasm.wasm.v1beta1.MsgInstantiateContract") + proto.RegisterType((*MsgInstantiateContractResponse)(nil), "cosmwasm.wasm.v1beta1.MsgInstantiateContractResponse") proto.RegisterType((*MsgExecuteContract)(nil), "cosmwasm.wasm.v1beta1.MsgExecuteContract") + proto.RegisterType((*MsgExecuteContractResponse)(nil), "cosmwasm.wasm.v1beta1.MsgExecuteContractResponse") proto.RegisterType((*MsgMigrateContract)(nil), "cosmwasm.wasm.v1beta1.MsgMigrateContract") + proto.RegisterType((*MsgMigrateContractResponse)(nil), "cosmwasm.wasm.v1beta1.MsgMigrateContractResponse") proto.RegisterType((*MsgUpdateAdmin)(nil), "cosmwasm.wasm.v1beta1.MsgUpdateAdmin") + proto.RegisterType((*MsgUpdateAdminResponse)(nil), "cosmwasm.wasm.v1beta1.MsgUpdateAdminResponse") proto.RegisterType((*MsgClearAdmin)(nil), "cosmwasm.wasm.v1beta1.MsgClearAdmin") + proto.RegisterType((*MsgClearAdminResponse)(nil), "cosmwasm.wasm.v1beta1.MsgClearAdminResponse") } func init() { proto.RegisterFile("x/wasm/internal/types/tx.proto", fileDescriptor_5129e02f2349864e) } var fileDescriptor_5129e02f2349864e = []byte{ - // 632 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0xe3, 0xa6, 0x4d, 0x9b, 0x6d, 0xa8, 0x90, 0xd5, 0x56, 0xa6, 0x20, 0x27, 0xa4, 0x97, - 0x5c, 0xb0, 0xdb, 0x22, 0xc1, 0x89, 0x43, 0x6d, 0x40, 0xea, 0xc1, 0x08, 0xb9, 0x42, 0x95, 0x7a, - 0xb1, 0xd6, 0xf6, 0x76, 0xd9, 0x12, 0xef, 0x46, 0x9e, 0x0d, 0x49, 0xdf, 0x82, 0xa7, 0xe0, 0x80, - 0x78, 0x90, 0x1e, 0x7b, 0xe4, 0x14, 0x20, 0xe5, 0xc8, 0x13, 0x70, 0x42, 0xbb, 0x76, 0x42, 0x2a, - 0x91, 0x2a, 0x12, 0xe2, 0x62, 0x67, 0x34, 0xff, 0xfc, 0x93, 0x6f, 0x76, 0xbc, 0xc8, 0x1e, 0xba, - 0x03, 0x0c, 0x99, 0xcb, 0xb8, 0x24, 0x39, 0xc7, 0x5d, 0x57, 0x5e, 0xf4, 0x08, 0xb8, 0x72, 0xe8, - 0xf4, 0x72, 0x21, 0x85, 0xb9, 0x95, 0x08, 0xc8, 0x94, 0xc2, 0xd1, 0x8f, 0xf7, 0xfb, 0x31, 0x91,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x7e, 0x2e, 0x30, 0x03, - 0x46, 0x73, 0xfc, 0x8f, 0x98, 0x0b, 0x6d, 0xc4, 0x33, 0xb4, 0x9e, 0x15, 0xbd, 0xf4, 0xf1, 0x2f, - 0x2f, 0x30, 0x13, 0x54, 0x16, 0x04, 0x40, 0xdb, 0x18, 0x6d, 0x04, 0x40, 0xdf, 0xf4, 0x52, 0x2c, - 0xc9, 0xa1, 0xde, 0xc3, 0x79, 0xff, 0xf4, 0x3e, 0xaa, 0x73, 0x32, 0x88, 0x66, 0x37, 0x77, 0x8d, - 0x93, 0x41, 0x51, 0x34, 0x8b, 0x51, 0xbd, 0x89, 0xd1, 0xf6, 0xd1, 0x9d, 0x00, 0xa8, 0xdf, 0x25, - 0x38, 0xbf, 0xbd, 0xc3, 0x2d, 0x26, 0xde, 0xab, 0xcb, 0xef, 0x76, 0xe5, 0x72, 0x6c, 0x1b, 0x57, - 0x63, 0xdb, 0xf8, 0x36, 0xb6, 0x8d, 0x0f, 0xd7, 0x76, 0xe5, 0xea, 0xda, 0xae, 0x7c, 0xb9, 0xb6, - 0x2b, 0xa7, 0x7b, 0x33, 0x27, 0xe5, 0x0b, 0xc8, 0x4e, 0xd4, 0x1d, 0xa5, 0x3e, 0xe5, 0xd4, 0x1d, - 0x96, 0xef, 0x9b, 0x37, 0x56, 0x5c, 0xd3, 0x97, 0xd5, 0xe3, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x7b, 0xfd, 0xe7, 0x34, 0x3e, 0x05, 0x00, 0x00, + // 818 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xeb, 0x44, + 0x14, 0x8e, 0x6f, 0xfe, 0x9a, 0x93, 0x70, 0x41, 0xa6, 0x2d, 0xc6, 0x20, 0x27, 0xf8, 0x82, 0x14, + 0x04, 0xb5, 0xdb, 0x22, 0x40, 0x02, 0xb1, 0x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0xbd, 0x33, 0x2a, 0xbf, 0xdc, 0x19, 0x95, 0x8b, 0xe3, 0xdc, 0x69, 0x36, + 0x64, 0x3c, 0x7c, 0x26, 0x2f, 0x10, 0x92, 0xd5, 0xb7, 0x17, 0xe9, 0xfb, 0xe1, 0x75, 0x62, 0xdc, + 0x88, 0x6f, 0x12, 0xef, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x01, 0xf3, 0xf7, 0xcc, 0xdb, 0x08, + 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // StoreCode to submit Wasm code to the system + StoreCode(ctx context.Context, in *MsgStoreCode, opts ...grpc.CallOption) (*MsgStoreCodeResponse, error) + // Instantiate creates a new smart contract instance for the given code id. + InstantiateContract(ctx context.Context, in *MsgInstantiateContract, opts ...grpc.CallOption) (*MsgInstantiateContractResponse, error) + // Execute submits the given message data to a smart contract + ExecuteContract(ctx context.Context, in *MsgExecuteContract, opts ...grpc.CallOption) (*MsgExecuteContractResponse, error) + // Migrate runs a code upgrade/ downgrade for a smart contract + MigrateContract(ctx context.Context, in *MsgMigrateContract, opts ...grpc.CallOption) (*MsgMigrateContractResponse, error) + // UpdateAdmin sets a new admin for a smart contract + UpdateAdmin(ctx context.Context, in *MsgUpdateAdmin, opts ...grpc.CallOption) (*MsgUpdateAdminResponse, error) + // ClearAdmin removes any admin stored for a smart contract + ClearAdmin(ctx context.Context, in *MsgClearAdmin, opts ...grpc.CallOption) (*MsgClearAdminResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) StoreCode(ctx context.Context, in *MsgStoreCode, opts ...grpc.CallOption) (*MsgStoreCodeResponse, error) { + out := new(MsgStoreCodeResponse) + err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1beta1.Msg/StoreCode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) InstantiateContract(ctx context.Context, in *MsgInstantiateContract, opts ...grpc.CallOption) (*MsgInstantiateContractResponse, error) { + out := new(MsgInstantiateContractResponse) + err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1beta1.Msg/InstantiateContract", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ExecuteContract(ctx context.Context, in *MsgExecuteContract, opts ...grpc.CallOption) (*MsgExecuteContractResponse, error) { + out := new(MsgExecuteContractResponse) + err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1beta1.Msg/ExecuteContract", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) MigrateContract(ctx context.Context, in *MsgMigrateContract, opts ...grpc.CallOption) (*MsgMigrateContractResponse, error) { + out := new(MsgMigrateContractResponse) + err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1beta1.Msg/MigrateContract", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateAdmin(ctx context.Context, in *MsgUpdateAdmin, opts ...grpc.CallOption) (*MsgUpdateAdminResponse, error) { + out := new(MsgUpdateAdminResponse) + err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1beta1.Msg/UpdateAdmin", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ClearAdmin(ctx context.Context, in *MsgClearAdmin, opts ...grpc.CallOption) (*MsgClearAdminResponse, error) { + out := new(MsgClearAdminResponse) + err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1beta1.Msg/ClearAdmin", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // StoreCode to submit Wasm code to the system + StoreCode(context.Context, *MsgStoreCode) (*MsgStoreCodeResponse, error) + // Instantiate creates a new smart contract instance for the given code id. + InstantiateContract(context.Context, *MsgInstantiateContract) (*MsgInstantiateContractResponse, error) + // Execute submits the given message data to a smart contract + ExecuteContract(context.Context, *MsgExecuteContract) (*MsgExecuteContractResponse, error) + // Migrate runs a code upgrade/ downgrade for a smart contract + MigrateContract(context.Context, *MsgMigrateContract) (*MsgMigrateContractResponse, error) + // UpdateAdmin sets a new admin for a smart contract + UpdateAdmin(context.Context, *MsgUpdateAdmin) (*MsgUpdateAdminResponse, error) + // ClearAdmin removes any admin stored for a smart contract + ClearAdmin(context.Context, *MsgClearAdmin) (*MsgClearAdminResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) StoreCode(ctx context.Context, req *MsgStoreCode) (*MsgStoreCodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StoreCode not implemented") +} +func (*UnimplementedMsgServer) InstantiateContract(ctx context.Context, req *MsgInstantiateContract) (*MsgInstantiateContractResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InstantiateContract not implemented") +} +func (*UnimplementedMsgServer) ExecuteContract(ctx context.Context, req *MsgExecuteContract) (*MsgExecuteContractResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecuteContract not implemented") +} +func (*UnimplementedMsgServer) MigrateContract(ctx context.Context, req *MsgMigrateContract) (*MsgMigrateContractResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MigrateContract not implemented") +} +func (*UnimplementedMsgServer) UpdateAdmin(ctx context.Context, req *MsgUpdateAdmin) (*MsgUpdateAdminResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateAdmin not implemented") +} +func (*UnimplementedMsgServer) ClearAdmin(ctx context.Context, req *MsgClearAdmin) (*MsgClearAdminResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClearAdmin not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_StoreCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgStoreCode) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).StoreCode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmwasm.wasm.v1beta1.Msg/StoreCode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).StoreCode(ctx, req.(*MsgStoreCode)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_InstantiateContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgInstantiateContract) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).InstantiateContract(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmwasm.wasm.v1beta1.Msg/InstantiateContract", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).InstantiateContract(ctx, req.(*MsgInstantiateContract)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ExecuteContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExecuteContract) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ExecuteContract(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmwasm.wasm.v1beta1.Msg/ExecuteContract", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ExecuteContract(ctx, req.(*MsgExecuteContract)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_MigrateContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgMigrateContract) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MigrateContract(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmwasm.wasm.v1beta1.Msg/MigrateContract", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MigrateContract(ctx, req.(*MsgMigrateContract)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateAdmin) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateAdmin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmwasm.wasm.v1beta1.Msg/UpdateAdmin", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateAdmin(ctx, req.(*MsgUpdateAdmin)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ClearAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClearAdmin) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ClearAdmin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmwasm.wasm.v1beta1.Msg/ClearAdmin", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ClearAdmin(ctx, req.(*MsgClearAdmin)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmwasm.wasm.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "StoreCode", + Handler: _Msg_StoreCode_Handler, + }, + { + MethodName: "InstantiateContract", + Handler: _Msg_InstantiateContract_Handler, + }, + { + MethodName: "ExecuteContract", + Handler: _Msg_ExecuteContract_Handler, + }, + { + MethodName: "MigrateContract", + Handler: _Msg_MigrateContract_Handler, + }, + { + MethodName: "UpdateAdmin", + Handler: _Msg_UpdateAdmin_Handler, + }, + { + MethodName: "ClearAdmin", + Handler: _Msg_ClearAdmin_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "x/wasm/internal/types/tx.proto", } func (m *MsgStoreCode) Marshal() (dAtA []byte, err error) { @@ -414,7 +939,7 @@ func (m *MsgStoreCode) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgInstantiateContract) Marshal() (dAtA []byte, err error) { +func (m *MsgStoreCodeResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -424,29 +949,59 @@ func (m *MsgInstantiateContract) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgInstantiateContract) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgStoreCodeResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgInstantiateContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgStoreCodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.InitFunds) > 0 { - for iNdEx := len(m.InitFunds) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.InitFunds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } + if len(m.CodeID) > 0 { + i -= len(m.CodeID) + copy(dAtA[i:], m.CodeID) + i = encodeVarintTx(dAtA, i, uint64(len(m.CodeID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgInstantiateContract) 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 *MsgInstantiateContract) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInstantiateContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.InitFunds) > 0 { + for iNdEx := len(m.InitFunds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InitFunds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } } if len(m.InitMsg) > 0 { i -= len(m.InitMsg) @@ -484,6 +1039,36 @@ func (m *MsgInstantiateContract) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgInstantiateContractResponse) 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 *MsgInstantiateContractResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInstantiateContractResponse) 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 = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *MsgExecuteContract) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -542,6 +1127,36 @@ func (m *MsgExecuteContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgExecuteContractResponse) 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 *MsgExecuteContractResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecuteContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTx(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *MsgMigrateContract) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -591,6 +1206,36 @@ func (m *MsgMigrateContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgMigrateContractResponse) 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 *MsgMigrateContractResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMigrateContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTx(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *MsgUpdateAdmin) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -635,6 +1280,29 @@ func (m *MsgUpdateAdmin) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgUpdateAdminResponse) 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 *MsgUpdateAdminResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateAdminResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgClearAdmin) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -672,6 +1340,29 @@ func (m *MsgClearAdmin) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgClearAdminResponse) 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 *MsgClearAdminResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClearAdminResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -712,6 +1403,19 @@ func (m *MsgStoreCode) Size() (n int) { return n } +func (m *MsgStoreCodeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CodeID) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func (m *MsgInstantiateContract) Size() (n int) { if m == nil { return 0 @@ -746,6 +1450,19 @@ func (m *MsgInstantiateContract) Size() (n int) { return n } +func (m *MsgInstantiateContractResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func (m *MsgExecuteContract) Size() (n int) { if m == nil { return 0 @@ -773,6 +1490,19 @@ func (m *MsgExecuteContract) Size() (n int) { return n } +func (m *MsgExecuteContractResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func (m *MsgMigrateContract) Size() (n int) { if m == nil { return 0 @@ -797,6 +1527,19 @@ func (m *MsgMigrateContract) Size() (n int) { return n } +func (m *MsgMigrateContractResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func (m *MsgUpdateAdmin) Size() (n int) { if m == nil { return 0 @@ -818,6 +1561,15 @@ func (m *MsgUpdateAdmin) Size() (n int) { return n } +func (m *MsgUpdateAdminResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgClearAdmin) Size() (n int) { if m == nil { return 0 @@ -832,16 +1584,329 @@ func (m *MsgClearAdmin) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - return n -} + return n +} + +func (m *MsgClearAdminResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgStoreCode) 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 ErrIntOverflowTx + } + 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: MsgStoreCode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgStoreCode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WASMByteCode", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WASMByteCode = append(m.WASMByteCode[:0], dAtA[iNdEx:postIndex]...) + if m.WASMByteCode == nil { + m.WASMByteCode = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Source = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Builder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Builder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InstantiatePermission", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.InstantiatePermission == nil { + m.InstantiatePermission = &AccessConfig{} + } + if err := m.InstantiatePermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgStoreCodeResponse) 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 ErrIntOverflowTx + } + 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: MsgStoreCodeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgStoreCodeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CodeID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { +func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -864,10 +1929,10 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgStoreCode: wiretype end group for non-group") + return fmt.Errorf("proto: MsgInstantiateContract: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgStoreCode: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgInstantiateContract: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -904,9 +1969,9 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WASMByteCode", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -916,29 +1981,46 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.WASMByteCode = append(m.WASMByteCode[:0], dAtA[iNdEx:postIndex]...) - if m.WASMByteCode == nil { - m.WASMByteCode = []byte{} - } + m.Admin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) + } + m.CodeID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CodeID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -966,13 +2048,13 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Source = string(dAtA[iNdEx:postIndex]) + m.Label = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Builder", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitMsg", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -982,27 +2064,29 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Builder = string(dAtA[iNdEx:postIndex]) + m.InitMsg = append(m.InitMsg[:0], dAtA[iNdEx:postIndex]...) + if m.InitMsg == nil { + m.InitMsg = []byte{} + } iNdEx = postIndex - case 5: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstantiatePermission", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitFunds", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1029,10 +2113,8 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.InstantiatePermission == nil { - m.InstantiatePermission = &AccessConfig{} - } - if err := m.InstantiatePermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.InitFunds = append(m.InitFunds, types.Coin{}) + if err := m.InitFunds[len(m.InitFunds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1060,7 +2142,7 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { +func (m *MsgInstantiateContractResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1083,15 +2165,15 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgInstantiateContract: wiretype end group for non-group") + return fmt.Errorf("proto: MsgInstantiateContractResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgInstantiateContract: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgInstantiateContractResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1119,11 +2201,64 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgExecuteContract) 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 ErrIntOverflowTx + } + 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: MsgExecuteContract: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecuteContract: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1151,13 +2286,13 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Admin = string(dAtA[iNdEx:postIndex]) + m.Sender = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) } - m.CodeID = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1167,16 +2302,29 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 4: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1186,29 +2334,31 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Label = string(dAtA[iNdEx:postIndex]) + m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) + if m.Msg == nil { + m.Msg = []byte{} + } iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SentFunds", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1218,31 +2368,84 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.InitMsg = append(m.InitMsg[:0], dAtA[iNdEx:postIndex]...) - if m.InitMsg == nil { - m.InitMsg = []byte{} + m.SentFunds = append(m.SentFunds, types.Coin{}) + if err := m.SentFunds[len(m.SentFunds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex - case 6: + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgExecuteContractResponse) 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 ErrIntOverflowTx + } + 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: MsgExecuteContractResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecuteContractResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitFunds", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1252,24 +2455,24 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.InitFunds = append(m.InitFunds, types.Coin{}) - if err := m.InitFunds[len(m.InitFunds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} } iNdEx = postIndex default: @@ -1296,7 +2499,7 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { +func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1319,10 +2522,10 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgExecuteContract: wiretype end group for non-group") + return fmt.Errorf("proto: MsgMigrateContract: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecuteContract: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgMigrateContract: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1390,10 +2593,10 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { m.Contract = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) } - var byteLen int + m.CodeID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1403,31 +2606,16 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + m.CodeID |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) - if m.Msg == nil { - m.Msg = []byte{} - } - iNdEx = postIndex - case 5: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SentFunds", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MigrateMsg", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1437,24 +2625,24 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.SentFunds = append(m.SentFunds, types.Coin{}) - if err := m.SentFunds[len(m.SentFunds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.MigrateMsg = append(m.MigrateMsg[:0], dAtA[iNdEx:postIndex]...) + if m.MigrateMsg == nil { + m.MigrateMsg = []byte{} } iNdEx = postIndex default: @@ -1481,7 +2669,7 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { +func (m *MsgMigrateContractResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1504,98 +2692,15 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgMigrateContract: wiretype end group for non-group") + return fmt.Errorf("proto: MsgMigrateContractResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgMigrateContract: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgMigrateContractResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contract = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) - } - m.CodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MigrateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -1622,9 +2727,9 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MigrateMsg = append(m.MigrateMsg[:0], dAtA[iNdEx:postIndex]...) - if m.MigrateMsg == nil { - m.MigrateMsg = []byte{} + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} } iNdEx = postIndex default: @@ -1800,6 +2905,59 @@ func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateAdminResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateAdminResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateAdminResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1917,6 +3075,59 @@ func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgClearAdminResponse) 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 ErrIntOverflowTx + } + 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: MsgClearAdminResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClearAdminResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/wasm/internal/types/tx.proto b/x/wasm/internal/types/tx.proto index e58842865b..dbfc544892 100644 --- a/x/wasm/internal/types/tx.proto +++ b/x/wasm/internal/types/tx.proto @@ -2,83 +2,125 @@ syntax = "proto3"; package cosmwasm.wasm.v1beta1; -import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; import "x/wasm/internal/types/types.proto"; option go_package = "github.com/CosmWasm/wasmd/x/wasmd/internal/types"; option (gogoproto.goproto_getters_all) = false; +// Msg defines the wasm Msg service. +service Msg { + // StoreCode to submit Wasm code to the system + rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse); + // Instantiate creates a new smart contract instance for the given code id. + rpc InstantiateContract(MsgInstantiateContract) returns (MsgInstantiateContractResponse); + // Execute submits the given message data to a smart contract + rpc ExecuteContract(MsgExecuteContract) returns (MsgExecuteContractResponse); + // Migrate runs a code upgrade/ downgrade for a smart contract + rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse); + // UpdateAdmin sets a new admin for a smart contract + rpc UpdateAdmin(MsgUpdateAdmin) returns (MsgUpdateAdminResponse); + // ClearAdmin removes any admin stored for a smart contract + rpc ClearAdmin(MsgClearAdmin) returns (MsgClearAdminResponse); +} // MsgStoreCode submit Wasm code to the system message MsgStoreCode { - // Sender is the that actor that signed the messages - string sender = 1; - // WASMByteCode can be raw or gzip compressed - bytes wasm_byte_code = 2 [(gogoproto.customname) = "WASMByteCode"]; - // Source is a valid absolute HTTPS URI to the contract's source code, optional - string source = 3; - // Builder is a valid docker image name with tag, optional - string builder = 4; - // InstantiatePermission access control to apply on contract creation, optional - AccessConfig instantiate_permission = 5; + // Sender is the that actor that signed the messages + string sender = 1; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 2 [(gogoproto.customname) = "WASMByteCode"]; + // Source is a valid absolute HTTPS URI to the contract's source code, optional + string source = 3; + // Builder is a valid docker image name with tag, optional + string builder = 4; + // InstantiatePermission access control to apply on contract creation, optional + AccessConfig instantiate_permission = 5; +} +// MsgStoreCodeResponse returns store result data. +message MsgStoreCodeResponse{ + // CodeID is the reference to the stored WASM code + string code_id = 1 [(gogoproto.customname) = "CodeID"]; } // MsgInstantiateContract create a new smart contract instance for the given code id. message MsgInstantiateContract { - // Sender is the that actor that signed the messages - string sender = 1; - // Admin is an optional address that can execute migrations - string admin = 2; - // CodeID is the reference to the stored WASM code - uint64 code_id = 3 [(gogoproto.customname) = "CodeID"]; - // Label is optional metadata to be stored with a contract instance. - string label = 4; - // InitMsg json encoded message to be passed to the contract on instantiation - bytes init_msg = 5 [(gogoproto.casttype) = "encoding/json.RawMessage"]; - // InitFunds coins that are transferred to the contract on instantiation - repeated cosmos.base.v1beta1.Coin init_funds = 6 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // Sender is the that actor that signed the messages + string sender = 1; + // Admin is an optional address that can execute migrations + string admin = 2; + // CodeID is the reference to the stored WASM code + uint64 code_id = 3 [(gogoproto.customname) = "CodeID"]; + // Label is optional metadata to be stored with a contract instance. + string label = 4; + // InitMsg json encoded message to be passed to the contract on instantiation + bytes init_msg = 5 [(gogoproto.casttype) = "encoding/json.RawMessage"]; + // InitFunds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin init_funds = 6 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} +// MsgInstantiateContractResponse return instantiation result data +message MsgInstantiateContractResponse { + // Address is the bech32 address of the new contract instance. + string address = 1; } // MsgExecuteContract submits the given message data to a smart contract message MsgExecuteContract { - // Sender is the that actor that signed the messages - string sender = 1; - // Contract is the address of the smart contract - string contract = 2; - // Msg json encoded message to be passed to the contract - bytes msg = 3 [(gogoproto.casttype) = "encoding/json.RawMessage"]; - // SentFunds coins that are transferred to the contract on execution - repeated cosmos.base.v1beta1.Coin sent_funds = 5 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // Sender is the that actor that signed the messages + string sender = 1; + // Contract is the address of the smart contract + string contract = 2; + // Msg json encoded message to be passed to the contract + bytes msg = 3 [(gogoproto.casttype) = "encoding/json.RawMessage"]; + // SentFunds coins that are transferred to the contract on execution + repeated cosmos.base.v1beta1.Coin sent_funds = 5 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgExecuteContractResponse returns execution result data. +message MsgExecuteContractResponse { + // Data contains base64-encoded bytes to returned from the contract + bytes data = 1; } // MsgMigrateContract runs a code upgrade/ downgrade for a smart contract message MsgMigrateContract { - // Sender is the that actor that signed the messages - string sender = 1; - // Contract is the address of the smart contract - string contract = 2; - // CodeID references the new WASM code - uint64 code_id = 3 [(gogoproto.customname) = "CodeID"]; - // MigrateMsg json encoded message to be passed to the contract on migration - bytes migrate_msg = 4 [(gogoproto.casttype) = "encoding/json.RawMessage"]; + // Sender is the that actor that signed the messages + string sender = 1; + // Contract is the address of the smart contract + string contract = 2; + // CodeID references the new WASM code + uint64 code_id = 3 [(gogoproto.customname) = "CodeID"]; + // MigrateMsg json encoded message to be passed to the contract on migration + bytes migrate_msg = 4 [(gogoproto.casttype) = "encoding/json.RawMessage"]; +} + +// MsgMigrateContractResponse returns contract migration result data. +message MsgMigrateContractResponse { + // Data contains base64-encoded bytes returned from the wasm contract. + bytes data = 1; } // MsgUpdateAdmin sets a new admin for a smart contract message MsgUpdateAdmin { - // Sender is the that actor that signed the messages - string sender = 1; - // NewAdmin address to be set - string new_admin = 2; - // Contract is the address of the smart contract - string contract = 3; + // Sender is the that actor that signed the messages + string sender = 1; + // NewAdmin address to be set + string new_admin = 2; + // Contract is the address of the smart contract + string contract = 3; } +// MsgUpdateAdminResponse returns empty data +message MsgUpdateAdminResponse{} // MsgClearAdmin removes any admin stored for a smart contract message MsgClearAdmin { - // Sender is the that actor that signed the messages - string sender = 1; - // Contract is the address of the smart contract - string contract = 3; + // Sender is the that actor that signed the messages + string sender = 1; + // Contract is the address of the smart contract + string contract = 3; } + +// MsgClearAdminResponse returns empty data +message MsgClearAdminResponse{} diff --git a/x/wasm/module.go b/x/wasm/module.go index 5a4aee1535..1d45ae517d 100644 --- a/x/wasm/module.go +++ b/x/wasm/module.go @@ -107,8 +107,9 @@ func NewAppModule(keeper *Keeper, validatorSetSource keeper.ValidatorSetSource) } } -func (am AppModule) RegisterServices(configurator module.Configurator) { - types.RegisterQueryServer(configurator.QueryServer(), NewQuerier(am.keeper)) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), NewQuerier(am.keeper)) } func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier { diff --git a/x/wasm/module_test.go b/x/wasm/module_test.go index 68fbe56f22..f60aa429e5 100644 --- a/x/wasm/module_test.go +++ b/x/wasm/module_test.go @@ -154,7 +154,9 @@ func TestHandleInstantiate(t *testing.T) { } res, err := h(data.ctx, msg) require.NoError(t, err) - require.Equal(t, res.Data, []byte("1")) + var pStoreResp MsgStoreCodeResponse + require.NoError(t, pStoreResp.Unmarshal(res.Data)) + require.Equal(t, pStoreResp.CodeID, "1") _, _, bob := keyPubAddr() _, _, fred := keyPubAddr() @@ -175,7 +177,10 @@ func TestHandleInstantiate(t *testing.T) { } res, err = h(data.ctx, &initCmd) require.NoError(t, err) - contractBech32Addr := string(res.Data) + var pInstResp MsgInstantiateContractResponse + require.NoError(t, pInstResp.Unmarshal(res.Data)) + contractBech32Addr := pInstResp.Address + require.Equal(t, "cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5", contractBech32Addr) // this should be standard x/wasm init event, nothing from contract require.Equal(t, 2, len(res.Events), prettyEvents(res.Events)) @@ -213,7 +218,9 @@ func TestHandleExecute(t *testing.T) { } res, err := h(data.ctx, msg) require.NoError(t, err) - require.Equal(t, res.Data, []byte("1")) + var pStoreResp MsgStoreCodeResponse + require.NoError(t, pStoreResp.Unmarshal(res.Data)) + require.Equal(t, pStoreResp.CodeID, "1") _, _, bob := keyPubAddr() initMsg := initMsg{ @@ -231,7 +238,10 @@ func TestHandleExecute(t *testing.T) { } res, err = h(data.ctx, &initCmd) require.NoError(t, err) - contractBech32Addr := string(res.Data) + var pInstResp MsgInstantiateContractResponse + require.NoError(t, pInstResp.Unmarshal(res.Data)) + contractBech32Addr := pInstResp.Address + require.Equal(t, "cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5", contractBech32Addr) // this should be standard x/wasm init event, plus a bank send event (2), with no custom contract events require.Equal(t, 3, len(res.Events), prettyEvents(res.Events)) @@ -265,6 +275,10 @@ func TestHandleExecute(t *testing.T) { } res, err = h(data.ctx, &execCmd) require.NoError(t, err) + var pExecResp MsgExecuteContractResponse + require.NoError(t, pExecResp.Unmarshal(res.Data)) + require.NotEmpty(t, pExecResp.Data) + // this should be standard x/wasm init event, plus 2 bank send event, plus a special event from the contract require.Equal(t, 4, len(res.Events), prettyEvents(res.Events)) @@ -327,7 +341,6 @@ func TestHandleExecuteEscrow(t *testing.T) { } res, err := h(data.ctx, msg) require.NoError(t, err) - require.Equal(t, res.Data, []byte("1")) _, _, bob := keyPubAddr() initMsg := map[string]interface{}{ @@ -345,7 +358,9 @@ func TestHandleExecuteEscrow(t *testing.T) { } res, err = h(data.ctx, &initCmd) require.NoError(t, err) - contractBech32Addr := string(res.Data) + var pInstResp MsgInstantiateContractResponse + require.NoError(t, pInstResp.Unmarshal(res.Data)) + contractBech32Addr := pInstResp.Address require.Equal(t, "cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5", contractBech32Addr) handleMsg := map[string]interface{}{ @@ -362,6 +377,9 @@ func TestHandleExecuteEscrow(t *testing.T) { } res, err = h(data.ctx, &execCmd) require.NoError(t, err) + var pExecResp MsgExecuteContractResponse + require.NoError(t, pExecResp.Unmarshal(res.Data)) + require.NotEmpty(t, pExecResp.Data) // ensure bob now exists and got both payments released bobAcct := data.acctKeeper.GetAccount(data.ctx, bob) From 202c19530e5b51577687dcfead6a235f15b527de Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Fri, 8 Jan 2021 15:26:02 +0100 Subject: [PATCH 3/7] Add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d430930ab8..a648b62249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ **Features:** +- Refactor to GRPC message server [\#366](https://github.com/CosmWasm/wasmd/pull/366) - Make it easy to initialize contracts in genesis file with new CLI commands[\#326](https://github.com/CosmWasm/wasmd/issues/326) - Upgrade to WasmVM v0.13.0 [\#358](https://github.com/CosmWasm/wasmd/pull/358) - Upgrade to cosmos-sdk v0.40.0-rc6 [\#354](https://github.com/CosmWasm/wasmd/pull/354) From 013491aa9d3002e1361547685c335683c7104b0c Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Fri, 8 Jan 2021 17:43:47 +0100 Subject: [PATCH 4/7] Pull out some test helpers for genesis_test --- x/wasm/common_test.go | 35 +++++++++++++++++++++++++++++++++++ x/wasm/genesis_test.go | 16 +++++----------- x/wasm/module_test.go | 30 +++++++++--------------------- 3 files changed, 49 insertions(+), 32 deletions(-) create mode 100644 x/wasm/common_test.go diff --git a/x/wasm/common_test.go b/x/wasm/common_test.go new file mode 100644 index 0000000000..e7519e4cd9 --- /dev/null +++ b/x/wasm/common_test.go @@ -0,0 +1,35 @@ +package wasm + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "strconv" + "testing" +) + +// ensure store code returns the expected response +func assertStoreCodeResponse(t *testing.T, data []byte, expected int64) { + var pStoreResp MsgStoreCodeResponse + require.NoError(t, pStoreResp.Unmarshal(data)) + // TODO: change this when it we store int natively + require.Equal(t, pStoreResp.CodeID, strconv.FormatInt(expected, 10)) +} + +// ensure execution returns the expected data +func assertExecuteResponse(t *testing.T, data []byte, expected []byte) { + var pExecResp MsgExecuteContractResponse + require.NoError(t, pExecResp.Unmarshal(data)) + require.Equal(t, pExecResp.Data, expected) +} + +// ensures this returns a valid bech32 address and returns it +func parseInitResponse(t *testing.T, data []byte) string { + var pInstResp MsgInstantiateContractResponse + require.NoError(t, pInstResp.Unmarshal(data)) + require.NotEmpty(t, pInstResp.Address) + addr := pInstResp.Address + // ensure this is a valid sdk address + _, err := sdk.AccAddressFromBech32(addr) + require.NoError(t, err) + return addr +} diff --git a/x/wasm/genesis_test.go b/x/wasm/genesis_test.go index e40d50b86d..42c621e5f4 100644 --- a/x/wasm/genesis_test.go +++ b/x/wasm/genesis_test.go @@ -22,7 +22,7 @@ func TestInitGenesis(t *testing.T) { msg := MsgStoreCode{ Sender: creator.String(), WASMByteCode: testContract, - Source: "https://github.com/CosmWasm/wasmd/blob/master/x/wasm/testdata/escrow.wasm", + Source: "https://github.com/CosmWasm/wasmd/blob/master/x/wasm/testdata/hackatom.wasm", Builder: "confio/cosmwasm-opt:0.7.0", } err := msg.ValidateBasic() @@ -30,10 +30,7 @@ func TestInitGenesis(t *testing.T) { res, err := h(data.ctx, &msg) require.NoError(t, err) - - var pStoreResp MsgStoreCodeResponse - require.NoError(t, pStoreResp.Unmarshal(res.Data)) - require.Equal(t, pStoreResp.CodeID, "1") + assertStoreCodeResponse(t, res.Data, 1) _, _, bob := keyPubAddr() initMsg := initMsg{ @@ -51,9 +48,7 @@ func TestInitGenesis(t *testing.T) { } res, err = h(data.ctx, &initCmd) require.NoError(t, err) - var pInstResp MsgInstantiateContractResponse - require.NoError(t, pInstResp.Unmarshal(res.Data)) - contractBech32Addr := pInstResp.Address + contractBech32Addr := parseInitResponse(t, res.Data) execCmd := MsgExecuteContract{ Sender: fred.String(), @@ -63,9 +58,8 @@ func TestInitGenesis(t *testing.T) { } res, err = h(data.ctx, &execCmd) require.NoError(t, err) - var pExecResp MsgExecuteContractResponse - require.NoError(t, pExecResp.Unmarshal(res.Data)) - require.NotEmpty(t, pExecResp.Data) + // from https://github.com/CosmWasm/cosmwasm/blob/master/contracts/hackatom/src/contract.rs#L167 + assertExecuteResponse(t, res.Data, []byte{0xf0, 0x0b, 0xaa}) // ensure all contract state is as after init assertCodeList(t, q, data.ctx, 1) diff --git a/x/wasm/module_test.go b/x/wasm/module_test.go index f60aa429e5..7291c10079 100644 --- a/x/wasm/module_test.go +++ b/x/wasm/module_test.go @@ -154,9 +154,7 @@ func TestHandleInstantiate(t *testing.T) { } res, err := h(data.ctx, msg) require.NoError(t, err) - var pStoreResp MsgStoreCodeResponse - require.NoError(t, pStoreResp.Unmarshal(res.Data)) - require.Equal(t, pStoreResp.CodeID, "1") + assertStoreCodeResponse(t, res.Data, 1) _, _, bob := keyPubAddr() _, _, fred := keyPubAddr() @@ -177,9 +175,7 @@ func TestHandleInstantiate(t *testing.T) { } res, err = h(data.ctx, &initCmd) require.NoError(t, err) - var pInstResp MsgInstantiateContractResponse - require.NoError(t, pInstResp.Unmarshal(res.Data)) - contractBech32Addr := pInstResp.Address + contractBech32Addr := parseInitResponse(t, res.Data) require.Equal(t, "cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5", contractBech32Addr) // this should be standard x/wasm init event, nothing from contract @@ -218,9 +214,7 @@ func TestHandleExecute(t *testing.T) { } res, err := h(data.ctx, msg) require.NoError(t, err) - var pStoreResp MsgStoreCodeResponse - require.NoError(t, pStoreResp.Unmarshal(res.Data)) - require.Equal(t, pStoreResp.CodeID, "1") + assertStoreCodeResponse(t, res.Data, 1) _, _, bob := keyPubAddr() initMsg := initMsg{ @@ -238,9 +232,7 @@ func TestHandleExecute(t *testing.T) { } res, err = h(data.ctx, &initCmd) require.NoError(t, err) - var pInstResp MsgInstantiateContractResponse - require.NoError(t, pInstResp.Unmarshal(res.Data)) - contractBech32Addr := pInstResp.Address + contractBech32Addr := parseInitResponse(t, res.Data) require.Equal(t, "cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5", contractBech32Addr) // this should be standard x/wasm init event, plus a bank send event (2), with no custom contract events @@ -275,9 +267,8 @@ func TestHandleExecute(t *testing.T) { } res, err = h(data.ctx, &execCmd) require.NoError(t, err) - var pExecResp MsgExecuteContractResponse - require.NoError(t, pExecResp.Unmarshal(res.Data)) - require.NotEmpty(t, pExecResp.Data) + // from https://github.com/CosmWasm/cosmwasm/blob/master/contracts/hackatom/src/contract.rs#L167 + assertExecuteResponse(t, res.Data, []byte{0xf0, 0x0b, 0xaa}) // this should be standard x/wasm init event, plus 2 bank send event, plus a special event from the contract require.Equal(t, 4, len(res.Events), prettyEvents(res.Events)) @@ -358,9 +349,7 @@ func TestHandleExecuteEscrow(t *testing.T) { } res, err = h(data.ctx, &initCmd) require.NoError(t, err) - var pInstResp MsgInstantiateContractResponse - require.NoError(t, pInstResp.Unmarshal(res.Data)) - contractBech32Addr := pInstResp.Address + contractBech32Addr := parseInitResponse(t, res.Data) require.Equal(t, "cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5", contractBech32Addr) handleMsg := map[string]interface{}{ @@ -377,9 +366,8 @@ func TestHandleExecuteEscrow(t *testing.T) { } res, err = h(data.ctx, &execCmd) require.NoError(t, err) - var pExecResp MsgExecuteContractResponse - require.NoError(t, pExecResp.Unmarshal(res.Data)) - require.NotEmpty(t, pExecResp.Data) + // from https://github.com/CosmWasm/cosmwasm/blob/master/contracts/hackatom/src/contract.rs#L167 + assertExecuteResponse(t, res.Data, []byte{0xf0, 0x0b, 0xaa}) // ensure bob now exists and got both payments released bobAcct := data.acctKeeper.GetAccount(data.ctx, bob) From 33333daf973d24c28df62d8108efc18277461701 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Fri, 8 Jan 2021 17:57:04 +0100 Subject: [PATCH 5/7] Change protobuf return for store code to return uint64 not string --- doc/proto.md | 390 +++++++++++++-------------- x/wasm/common_test.go | 6 +- x/wasm/internal/keeper/msg_server.go | 2 +- x/wasm/internal/types/tx.pb.go | 138 +++++----- x/wasm/internal/types/tx.proto | 2 +- 5 files changed, 260 insertions(+), 278 deletions(-) diff --git a/doc/proto.md b/doc/proto.md index 571fe8d60e..17c0723ad1 100644 --- a/doc/proto.md +++ b/doc/proto.md @@ -17,6 +17,19 @@ - [StoreCodeProposal](#cosmwasm.wasm.v1beta1.StoreCodeProposal) - [UpdateAdminProposal](#cosmwasm.wasm.v1beta1.UpdateAdminProposal) +- [x/wasm/internal/types/types.proto](#x/wasm/internal/types/types.proto) + - [AbsoluteTxPosition](#cosmwasm.wasm.v1beta1.AbsoluteTxPosition) + - [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) + - [AccessTypeParam](#cosmwasm.wasm.v1beta1.AccessTypeParam) + - [CodeInfo](#cosmwasm.wasm.v1beta1.CodeInfo) + - [ContractCodeHistoryEntry](#cosmwasm.wasm.v1beta1.ContractCodeHistoryEntry) + - [ContractInfo](#cosmwasm.wasm.v1beta1.ContractInfo) + - [Model](#cosmwasm.wasm.v1beta1.Model) + - [Params](#cosmwasm.wasm.v1beta1.Params) + + - [AccessType](#cosmwasm.wasm.v1beta1.AccessType) + - [ContractCodeHistoryOperationType](#cosmwasm.wasm.v1beta1.ContractCodeHistoryOperationType) + - [x/wasm/internal/types/query.proto](#x/wasm/internal/types/query.proto) - [CodeInfoResponse](#cosmwasm.wasm.v1beta1.CodeInfoResponse) - [ContractInfoWithAddress](#cosmwasm.wasm.v1beta1.ContractInfoWithAddress) @@ -55,19 +68,6 @@ - [Msg](#cosmwasm.wasm.v1beta1.Msg) -- [x/wasm/internal/types/types.proto](#x/wasm/internal/types/types.proto) - - [AbsoluteTxPosition](#cosmwasm.wasm.v1beta1.AbsoluteTxPosition) - - [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) - - [AccessTypeParam](#cosmwasm.wasm.v1beta1.AccessTypeParam) - - [CodeInfo](#cosmwasm.wasm.v1beta1.CodeInfo) - - [ContractCodeHistoryEntry](#cosmwasm.wasm.v1beta1.ContractCodeHistoryEntry) - - [ContractInfo](#cosmwasm.wasm.v1beta1.ContractInfo) - - [Model](#cosmwasm.wasm.v1beta1.Model) - - [Params](#cosmwasm.wasm.v1beta1.Params) - - - [AccessType](#cosmwasm.wasm.v1beta1.AccessType) - - [ContractCodeHistoryOperationType](#cosmwasm.wasm.v1beta1.ContractCodeHistoryOperationType) - - [Scalar Value Types](#scalar-value-types) @@ -289,6 +289,186 @@ UpdateAdminProposal gov proposal content type to set an admin for a contract. + +

Top

+ +## x/wasm/internal/types/types.proto + + + + + +### AbsoluteTxPosition +AbsoluteTxPosition is a unique transaction position that allows for global ordering of transactions. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| block_height | [uint64](#uint64) | | BlockHeight is the block the contract was created at | +| tx_index | [uint64](#uint64) | | TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed) | + + + + + + + + +### AccessConfig +AccessConfig access control type. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| permission | [AccessType](#cosmwasm.wasm.v1beta1.AccessType) | | | +| address | [string](#string) | | | + + + + + + + + +### AccessTypeParam +AccessTypeParam + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| value | [AccessType](#cosmwasm.wasm.v1beta1.AccessType) | | | + + + + + + + + +### CodeInfo +CodeInfo is data for the uploaded contract WASM code + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| code_hash | [bytes](#bytes) | | CodeHash is the unique CodeID | +| creator | [string](#string) | | Creator address who initially stored the code | +| source | [string](#string) | | Source is a valid absolute HTTPS URI to the contract's source code, optional | +| builder | [string](#string) | | Builder is a valid docker image name with tag, optional | +| instantiate_config | [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) | | InstantiateConfig access control to apply on contract creation, optional | + + + + + + + + +### ContractCodeHistoryEntry +ContractCodeHistoryEntry metadata to a contract. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| operation | [ContractCodeHistoryOperationType](#cosmwasm.wasm.v1beta1.ContractCodeHistoryOperationType) | | | +| code_id | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | +| updated | [AbsoluteTxPosition](#cosmwasm.wasm.v1beta1.AbsoluteTxPosition) | | Updated Tx position when the operation was executed. | +| msg | [bytes](#bytes) | | | + + + + + + + + +### ContractInfo +ContractInfo stores a WASM contract instance + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| code_id | [uint64](#uint64) | | CodeID is the reference to the stored Wasm code | +| creator | [string](#string) | | Creator address who initially instantiated the contract | +| admin | [string](#string) | | Admin is an optional address that can execute migrations | +| label | [string](#string) | | Label is optional metadata to be stored with a contract instance. | +| created | [AbsoluteTxPosition](#cosmwasm.wasm.v1beta1.AbsoluteTxPosition) | | Created Tx position when the contract was instantiated. This data should kept internal and not be exposed via query results. Just use for sorting | + + + + + + + + +### Model +Model is a struct that holds a KV pair + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [bytes](#bytes) | | hex-encode key to read it better (this is often ascii) | +| value | [bytes](#bytes) | | base64-encode raw value | + + + + + + + + +### Params +Params defines the set of wasm parameters. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| code_upload_access | [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) | | | +| instantiate_default_permission | [AccessType](#cosmwasm.wasm.v1beta1.AccessType) | | | +| max_wasm_code_size | [uint64](#uint64) | | | + + + + + + + + + + +### AccessType +AccessType permission types + +| Name | Number | Description | +| ---- | ------ | ----------- | +| ACCESS_TYPE_UNSPECIFIED | 0 | AccessTypeUnspecified placeholder for empty value | +| ACCESS_TYPE_NOBODY | 1 | AccessTypeNobody forbidden | +| ACCESS_TYPE_ONLY_ADDRESS | 2 | AccessTypeOnlyAddress restricted to an address | +| ACCESS_TYPE_EVERYBODY | 3 | AccessTypeEverybody unrestricted | + + + + + +### ContractCodeHistoryOperationType +ContractCodeHistoryOperationType actions that caused a code change + +| Name | Number | Description | +| ---- | ------ | ----------- | +| CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED | 0 | ContractCodeHistoryOperationTypeUnspecified placeholder for empty value | +| CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT | 1 | ContractCodeHistoryOperationTypeInit on chain contract instantiation | +| CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE | 2 | ContractCodeHistoryOperationTypeMigrate code migration | +| CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS | 3 | ContractCodeHistoryOperationTypeGenesis based on genesis data | + + + + + + + + + +

Top

@@ -702,7 +882,7 @@ MsgInstantiateContractResponse return instantiation result data | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [string](#string) | | Address is the address of the new contract instance. | +| address | [string](#string) | | Address is the bech32 address of the new contract instance. | @@ -769,7 +949,7 @@ MsgStoreCodeResponse returns store result data. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| code_id | [string](#string) | | CodeID is the reference to the stored WASM code | +| code_id | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | @@ -827,186 +1007,6 @@ Msg defines the wasm Msg service. - -

Top

- -## x/wasm/internal/types/types.proto - - - - - -### AbsoluteTxPosition -AbsoluteTxPosition is a unique transaction position that allows for global ordering of transactions. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| block_height | [uint64](#uint64) | | BlockHeight is the block the contract was created at | -| tx_index | [uint64](#uint64) | | TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed) | - - - - - - - - -### AccessConfig -AccessConfig access control type. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| permission | [AccessType](#cosmwasm.wasm.v1beta1.AccessType) | | | -| address | [string](#string) | | | - - - - - - - - -### AccessTypeParam -AccessTypeParam - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| value | [AccessType](#cosmwasm.wasm.v1beta1.AccessType) | | | - - - - - - - - -### CodeInfo -CodeInfo is data for the uploaded contract WASM code - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| code_hash | [bytes](#bytes) | | CodeHash is the unique CodeID | -| creator | [string](#string) | | Creator address who initially stored the code | -| source | [string](#string) | | Source is a valid absolute HTTPS URI to the contract's source code, optional | -| builder | [string](#string) | | Builder is a valid docker image name with tag, optional | -| instantiate_config | [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) | | InstantiateConfig access control to apply on contract creation, optional | - - - - - - - - -### ContractCodeHistoryEntry -ContractCodeHistoryEntry metadata to a contract. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| operation | [ContractCodeHistoryOperationType](#cosmwasm.wasm.v1beta1.ContractCodeHistoryOperationType) | | | -| code_id | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | -| updated | [AbsoluteTxPosition](#cosmwasm.wasm.v1beta1.AbsoluteTxPosition) | | Updated Tx position when the operation was executed. | -| msg | [bytes](#bytes) | | | - - - - - - - - -### ContractInfo -ContractInfo stores a WASM contract instance - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| code_id | [uint64](#uint64) | | CodeID is the reference to the stored Wasm code | -| creator | [string](#string) | | Creator address who initially instantiated the contract | -| admin | [string](#string) | | Admin is an optional address that can execute migrations | -| label | [string](#string) | | Label is optional metadata to be stored with a contract instance. | -| created | [AbsoluteTxPosition](#cosmwasm.wasm.v1beta1.AbsoluteTxPosition) | | Created Tx position when the contract was instantiated. This data should kept internal and not be exposed via query results. Just use for sorting | - - - - - - - - -### Model -Model is a struct that holds a KV pair - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| key | [bytes](#bytes) | | hex-encode key to read it better (this is often ascii) | -| value | [bytes](#bytes) | | base64-encode raw value | - - - - - - - - -### Params -Params defines the set of wasm parameters. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| code_upload_access | [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) | | | -| instantiate_default_permission | [AccessType](#cosmwasm.wasm.v1beta1.AccessType) | | | -| max_wasm_code_size | [uint64](#uint64) | | | - - - - - - - - - - -### AccessType -AccessType permission types - -| Name | Number | Description | -| ---- | ------ | ----------- | -| ACCESS_TYPE_UNSPECIFIED | 0 | AccessTypeUnspecified placeholder for empty value | -| ACCESS_TYPE_NOBODY | 1 | AccessTypeNobody forbidden | -| ACCESS_TYPE_ONLY_ADDRESS | 2 | AccessTypeOnlyAddress restricted to an address | -| ACCESS_TYPE_EVERYBODY | 3 | AccessTypeEverybody unrestricted | - - - - - -### ContractCodeHistoryOperationType -ContractCodeHistoryOperationType actions that caused a code change - -| Name | Number | Description | -| ---- | ------ | ----------- | -| CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED | 0 | ContractCodeHistoryOperationTypeUnspecified placeholder for empty value | -| CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT | 1 | ContractCodeHistoryOperationTypeInit on chain contract instantiation | -| CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE | 2 | ContractCodeHistoryOperationTypeMigrate code migration | -| CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS | 3 | ContractCodeHistoryOperationTypeGenesis based on genesis data | - - - - - - - - - - ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | diff --git a/x/wasm/common_test.go b/x/wasm/common_test.go index e7519e4cd9..2b2d499ff8 100644 --- a/x/wasm/common_test.go +++ b/x/wasm/common_test.go @@ -3,16 +3,14 @@ package wasm import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "strconv" "testing" ) // ensure store code returns the expected response -func assertStoreCodeResponse(t *testing.T, data []byte, expected int64) { +func assertStoreCodeResponse(t *testing.T, data []byte, expected uint64) { var pStoreResp MsgStoreCodeResponse require.NoError(t, pStoreResp.Unmarshal(data)) - // TODO: change this when it we store int natively - require.Equal(t, pStoreResp.CodeID, strconv.FormatInt(expected, 10)) + require.Equal(t, pStoreResp.CodeID, expected) } // ensure execution returns the expected data diff --git a/x/wasm/internal/keeper/msg_server.go b/x/wasm/internal/keeper/msg_server.go index 8c33cf6f34..2bf2000319 100644 --- a/x/wasm/internal/keeper/msg_server.go +++ b/x/wasm/internal/keeper/msg_server.go @@ -37,7 +37,7 @@ func (m msgServer) StoreCode(goCtx context.Context, msg *types.MsgStoreCode) (*t )) return &types.MsgStoreCodeResponse{ - CodeID: fmt.Sprintf("%d", codeID), + CodeID: codeID, }, nil } diff --git a/x/wasm/internal/types/tx.pb.go b/x/wasm/internal/types/tx.pb.go index 2a9eea1893..7a85f52d71 100644 --- a/x/wasm/internal/types/tx.pb.go +++ b/x/wasm/internal/types/tx.pb.go @@ -81,7 +81,7 @@ var xxx_messageInfo_MsgStoreCode proto.InternalMessageInfo // MsgStoreCodeResponse returns store result data. type MsgStoreCodeResponse struct { // CodeID is the reference to the stored WASM code - CodeID string `protobuf:"bytes,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` + CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` } func (m *MsgStoreCodeResponse) Reset() { *m = MsgStoreCodeResponse{} } @@ -168,7 +168,7 @@ var xxx_messageInfo_MsgInstantiateContract proto.InternalMessageInfo // MsgInstantiateContractResponse return instantiation result data type MsgInstantiateContractResponse struct { - // Address is the address of the new contract instance. + // Address is the bech32 address of the new contract instance. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } @@ -550,57 +550,57 @@ func init() { proto.RegisterFile("x/wasm/internal/types/tx.proto", fileDescripto var fileDescriptor_5129e02f2349864e = []byte{ // 818 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xeb, 0x44, - 0x14, 0x8e, 0x6f, 0xfe, 0x9a, 0x93, 0x70, 0x41, 0xa6, 0x2d, 0xc6, 0x20, 0x27, 0xf8, 0x82, 0x14, - 0x04, 0xb5, 0xdb, 0x22, 0x40, 0x02, 0xb1, 0x68, 0x02, 0x48, 0x5d, 0x18, 0x21, 0x5f, 0xa1, 0x2b, - 0x55, 0x42, 0x61, 0x62, 0x4f, 0xcd, 0x94, 0x78, 0x26, 0xf2, 0x4c, 0x48, 0x2a, 0xde, 0x80, 0x15, - 0x4f, 0xc1, 0x02, 0xf1, 0x20, 0x5d, 0x76, 0xc9, 0x2a, 0x40, 0xca, 0x92, 0x27, 0x60, 0x85, 0xc6, - 0x76, 0x5c, 0x37, 0xc4, 0x91, 0x11, 0x62, 0x63, 0xcf, 0x19, 0x7f, 0xe7, 0xfb, 0x7c, 0x3e, 0x9d, - 0x33, 0x1a, 0x30, 0x16, 0xf6, 0x1c, 0xf1, 0xd0, 0x26, 0x54, 0xe0, 0x88, 0xa2, 0x89, 0x2d, 0xae, - 0xa7, 0x98, 0xdb, 0x62, 0x61, 0x4d, 0x23, 0x26, 0x98, 0x7a, 0xe0, 0x31, 0x1e, 0x4a, 0x84, 0x15, - 0x3f, 0xbe, 0x3d, 0x19, 0x63, 0x81, 0x4e, 0x74, 0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, 0xb1, 0x05, 0xae, - 0xbf, 0xfb, 0xaf, 0xe0, 0x99, 0x38, 0x83, 0xe7, 0x37, 0x87, 0xf6, 0xcd, 0x62, 0xa6, 0x0d, 0xa8, - 0x7e, 0x52, 0x1a, 0x9a, 0x17, 0xdc, 0x1c, 0x86, 0x1d, 0x82, 0x1b, 0xd0, 0x5d, 0x82, 0x45, 0x4d, - 0xeb, 0x41, 0x3b, 0xdf, 0x9d, 0x6f, 0x14, 0x33, 0xe4, 0x60, 0xfa, 0x51, 0x29, 0x58, 0x26, 0xf2, - 0x15, 0x40, 0xae, 0x0b, 0x5f, 0x2f, 0x4e, 0xbe, 0x47, 0xe9, 0x6f, 0x97, 0x41, 0xad, 0x15, 0x06, - 0x9f, 0xdd, 0xfc, 0x6e, 0x54, 0x6e, 0x56, 0x86, 0x72, 0xbb, 0x32, 0x94, 0xdf, 0x56, 0x86, 0xf2, - 0xc3, 0x9d, 0x51, 0xb9, 0xbd, 0x33, 0x2a, 0xbf, 0xdc, 0x19, 0x95, 0x8b, 0xe3, 0xdc, 0x69, 0x36, - 0x64, 0x3c, 0x7c, 0x26, 0x2f, 0x10, 0x92, 0xd5, 0xb7, 0x17, 0xe9, 0xfb, 0xe1, 0x75, 0x62, 0xdc, - 0x88, 0x6f, 0x12, 0xef, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x01, 0xf3, 0xf7, 0xcc, 0xdb, 0x08, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x41, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0x37, 0x6d, 0xd2, 0xbc, 0x84, 0x05, 0x99, 0xb6, 0x18, 0x83, 0x9c, 0xe0, 0x05, 0x29, + 0x08, 0x6a, 0xb7, 0x45, 0x80, 0x04, 0xe2, 0xd0, 0x04, 0x90, 0x7a, 0x30, 0x42, 0x5e, 0xa1, 0x95, + 0x56, 0x42, 0x61, 0x62, 0xcf, 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69, 0x36, + 0x64, 0x3c, 0x7e, 0x24, 0x2f, 0x10, 0x92, 0x35, 0x74, 0x17, 0xd9, 0xfb, 0xee, 0x75, 0x62, 0xdc, + 0x50, 0x37, 0x89, 0x77, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x2c, 0xda, 0x83, 0x14, 0xdb, 0x08, 0x00, 0x00, } @@ -959,12 +959,10 @@ func (m *MsgStoreCodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.CodeID) > 0 { - i -= len(m.CodeID) - copy(dAtA[i:], m.CodeID) - i = encodeVarintTx(dAtA, i, uint64(len(m.CodeID))) + if m.CodeID != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CodeID)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -1409,9 +1407,8 @@ func (m *MsgStoreCodeResponse) Size() (n int) { } var l int _ = l - l = len(m.CodeID) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.CodeID != 0 { + n += 1 + sovTx(uint64(m.CodeID)) } return n } @@ -1851,10 +1848,10 @@ func (m *MsgStoreCodeResponse) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) } - var stringLen uint64 + m.CodeID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1864,24 +1861,11 @@ func (m *MsgStoreCodeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.CodeID |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/wasm/internal/types/tx.proto b/x/wasm/internal/types/tx.proto index dbfc544892..8ead7cde1e 100644 --- a/x/wasm/internal/types/tx.proto +++ b/x/wasm/internal/types/tx.proto @@ -41,7 +41,7 @@ message MsgStoreCode { // MsgStoreCodeResponse returns store result data. message MsgStoreCodeResponse{ // CodeID is the reference to the stored WASM code - string code_id = 1 [(gogoproto.customname) = "CodeID"]; + uint64 code_id = 1 [(gogoproto.customname) = "CodeID"]; } // MsgInstantiateContract create a new smart contract instance for the given code id. From adcbf2f3a7dfa1286958105ab6f36ad7a7b45a4b Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Fri, 8 Jan 2021 17:59:54 +0100 Subject: [PATCH 6/7] Pin prototools to a fixed version in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4b89bc8222..8ecb8d5afa 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ LEDGER_ENABLED ?= true SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') # for dockerized protobuf tools -PROTO_CONTAINER := cosmwasm/prototools-docker:latest +PROTO_CONTAINER := cosmwasm/prototools-docker:v0.1.0 DOCKER_BUF := docker run --rm -v $(shell pwd)/buf.yaml:/workspace/buf.yaml -v $(shell go list -f "{{ .Dir }}" -m github.com/cosmos/cosmos-sdk):/workspace/cosmos_sdk_dir -v $(shell pwd):/workspace/wasmd --workdir /workspace $(PROTO_CONTAINER) HTTPS_GIT := https://github.com/CosmWasm/wasmd.git From 5f8c246d25e8be640fb401fda4bbf82db37e9e90 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Fri, 8 Jan 2021 18:02:21 +0100 Subject: [PATCH 7/7] Update comment on execute return value --- doc/proto.md | 2 +- x/wasm/internal/types/tx.pb.go | 3 ++- x/wasm/internal/types/tx.proto | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/proto.md b/doc/proto.md index 17c0723ad1..c32ecf6109 100644 --- a/doc/proto.md +++ b/doc/proto.md @@ -915,7 +915,7 @@ MsgMigrateContractResponse returns contract migration result data. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| data | [bytes](#bytes) | | Data contains base64-encoded bytes returned from the wasm contract. | +| data | [bytes](#bytes) | | Data contains same raw bytes returned as data from the wasm contract. (May be empty) | diff --git a/x/wasm/internal/types/tx.pb.go b/x/wasm/internal/types/tx.pb.go index 7a85f52d71..7399d9ee8c 100644 --- a/x/wasm/internal/types/tx.pb.go +++ b/x/wasm/internal/types/tx.pb.go @@ -336,7 +336,8 @@ var xxx_messageInfo_MsgMigrateContract proto.InternalMessageInfo // MsgMigrateContractResponse returns contract migration result data. type MsgMigrateContractResponse struct { - // Data contains base64-encoded bytes returned from the wasm contract. + // Data contains same raw bytes returned as data from the wasm contract. + // (May be empty) Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` } diff --git a/x/wasm/internal/types/tx.proto b/x/wasm/internal/types/tx.proto index 8ead7cde1e..c40e3ba469 100644 --- a/x/wasm/internal/types/tx.proto +++ b/x/wasm/internal/types/tx.proto @@ -97,7 +97,8 @@ message MsgMigrateContract { // MsgMigrateContractResponse returns contract migration result data. message MsgMigrateContractResponse { - // Data contains base64-encoded bytes returned from the wasm contract. + // Data contains same raw bytes returned as data from the wasm contract. + // (May be empty) bytes data = 1; }