diff --git a/go.mod b/go.mod index f7aafba0b2..caa1629c6b 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( // Note: update ENV GO_COSMWASM in Dockerfile when updating this github.com/CosmWasm/go-cosmwasm v0.9.1 github.com/cosmos/cosmos-sdk v0.34.4-0.20200530180557-ba70f4d4dc2e + github.com/gogo/protobuf v1.3.1 github.com/google/gofuzz v1.0.0 github.com/gorilla/mux v1.7.4 github.com/onsi/ginkgo v1.8.0 // indirect diff --git a/go.sum b/go.sum index 176dbd838d..bc9a67530f 100644 --- a/go.sum +++ b/go.sum @@ -20,12 +20,10 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200102211924-4bcbc698314f h1:4O1om+UVU+Hfcihr1timk8YNXHxzZWgCo7ofnrZRApw= github.com/ChainSafe/go-schnorrkel v0.0.0-20200102211924-4bcbc698314f/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CosmWasm/go-cosmwasm v0.9.1 h1:w5s2o7H3cmNexct9yv8F6OLXwgxbdfVApwam7DibPqI= -github.com/CosmWasm/go-cosmwasm v0.9.1/go.mod h1:gAFCwllx97ejI+m9SqJQrmd2SBW7HA0fOjvWWJjM2uc= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CosmWasm/go-cosmwasm v0.8.1-0.20200604114456-1b2359bb7eb9 h1:UJOWFHfh2SG47GJcQsjbcEnfw7JM4HPM2cFO1fjjqEs= -github.com/CosmWasm/go-cosmwasm v0.8.1-0.20200604114456-1b2359bb7eb9/go.mod h1:gAFCwllx97ejI+m9SqJQrmd2SBW7HA0fOjvWWJjM2uc= +github.com/CosmWasm/go-cosmwasm v0.9.1 h1:w5s2o7H3cmNexct9yv8F6OLXwgxbdfVApwam7DibPqI= +github.com/CosmWasm/go-cosmwasm v0.9.1/go.mod h1:gAFCwllx97ejI+m9SqJQrmd2SBW7HA0fOjvWWJjM2uc= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= diff --git a/x/wasm/alias.go b/x/wasm/alias.go index be9338ee64..4c3f7f720a 100644 --- a/x/wasm/alias.go +++ b/x/wasm/alias.go @@ -46,7 +46,6 @@ var ( NewContractInfo = types.NewContractInfo NewEnv = types.NewEnv NewWasmCoins = types.NewWasmCoins - ParseEvents = types.ParseEvents DefaultWasmConfig = types.DefaultWasmConfig InitGenesis = keeper.InitGenesis ExportGenesis = keeper.ExportGenesis diff --git a/x/wasm/client/cli/new_tx.go b/x/wasm/client/cli/new_tx.go index 320a2f01c2..7304b7d2f1 100644 --- a/x/wasm/client/cli/new_tx.go +++ b/x/wasm/client/cli/new_tx.go @@ -89,7 +89,7 @@ func ClearContractAdminCmd(cdc *codec.Codec) *cobra.Command { Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { inBuf := bufio.NewReader(cmd.InOrStdin()) - txBldr := auth.NewTxBuilderFromCLI(inBuf).WithTxEncoder(utils.GetTxEncoder(cdc)) + txBldr := auth.NewTxBuilderFromCLI(inBuf).WithTxEncoder(authclient.GetTxEncoder(cdc)) cliCtx := context.NewCLIContextWithInput(inBuf).WithCodec(cdc) contractAddr, err := sdk.AccAddressFromBech32(args[0]) @@ -101,7 +101,7 @@ func ClearContractAdminCmd(cdc *codec.Codec) *cobra.Command { Sender: cliCtx.GetFromAddress(), Contract: contractAddr, } - return utils.GenerateOrBroadcastMsgs(cliCtx, txBldr, []sdk.Msg{msg}) + return authclient.GenerateOrBroadcastMsgs(cliCtx, txBldr, []sdk.Msg{msg}) }, } return cmd diff --git a/x/wasm/handler.go b/x/wasm/handler.go index 5f11ca3db8..ca8f81546f 100644 --- a/x/wasm/handler.go +++ b/x/wasm/handler.go @@ -135,7 +135,7 @@ func handleExecute(ctx sdk.Context, k Keeper, msg *MsgExecuteContract) (*sdk.Res events = append(events, custom.ToABCIEvents()...) res.Events = events - return &res, nil + return res, nil } func handleMigration(ctx sdk.Context, k Keeper, msg *MsgMigrateContract) (*sdk.Result, error) { diff --git a/x/wasm/internal/keeper/genesis_test.go b/x/wasm/internal/keeper/genesis_test.go index 69c687e989..6497be016d 100644 --- a/x/wasm/internal/keeper/genesis_test.go +++ b/x/wasm/internal/keeper/genesis_test.go @@ -378,9 +378,9 @@ func setupKeeper(t *testing.T) (Keeper, sdk.Context, func()) { Time: time.Date(2020, time.April, 22, 12, 0, 0, 0, time.UTC), }, false, log.NewNopLogger()) - cdc := MakeTestCodec() + appCodec, _ := MakeTestCodec() wasmConfig := wasmTypes.DefaultWasmConfig() - srcKeeper := NewKeeper(cdc, keyContract, auth.AccountKeeper{}, nil, staking.Keeper{}, nil, tempDir, wasmConfig, "", nil, nil) + srcKeeper := NewKeeper(appCodec, keyContract, auth.AccountKeeper{}, nil, staking.Keeper{}, nil, tempDir, wasmConfig, "", nil, nil) return srcKeeper, ctx, cleanup } diff --git a/x/wasm/internal/keeper/keeper.go b/x/wasm/internal/keeper/keeper.go index 1633397e74..d0c197ebc1 100644 --- a/x/wasm/internal/keeper/keeper.go +++ b/x/wasm/internal/keeper/keeper.go @@ -117,7 +117,7 @@ func (k Keeper) importCode(ctx sdk.Context, codeID uint64, codeInfo types.CodeIn return sdkerrors.Wrapf(types.ErrDuplicate, "duplicate code: %d", codeID) } // 0x01 | codeID (uint64) -> ContractInfo - store.Set(key, k.cdc.MustMarshalBinaryBare(codeInfo)) + store.Set(key, k.cdc.MustMarshalBinaryBare(&codeInfo)) return nil } @@ -177,7 +177,7 @@ func (k Keeper) Instantiate(ctx sdk.Context, codeID uint64, creator, admin sdk.A } // emit all events from this contract itself - _, events := types.CosmosResult(*res, contractAddress) + events := types.ConvertToEvents(res.Log, contractAddress) ctx.EventManager().EmitEvents(events) err = k.dispatchMessages(ctx, contractAddress, res.Messages) @@ -234,9 +234,7 @@ func (k Keeper) Execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller return nil, err } - return &sdk.Result{ - Data: res.Data, - }, nil + return &sdk.Result{Data: data}, nil } // Migrate allows to upgrade a contract to a new code with data migration. @@ -277,7 +275,7 @@ func (k Keeper) Migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller } // emit all events from this contract migration itself - data, events := types.CosmosResult(*res, contractAddress) + events := types.ConvertToEvents(res.Log, contractAddress) ctx.EventManager().EmitEvents(events) contractInfo.UpdateCodeID(ctx, newCodeID) @@ -287,7 +285,7 @@ func (k Keeper) Migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller return nil, sdkerrors.Wrap(err, "dispatch") } - return &sdk.Result{Data: data}, nil + return &sdk.Result{Data: res.Data}, nil } // UpdateContractAdmin sets the admin value on the ContractInfo. It must be a valid address (use ClearContractAdmin to remove it) diff --git a/x/wasm/internal/keeper/keeper_test.go b/x/wasm/internal/keeper/keeper_test.go index 5209814872..8d4222cb7d 100644 --- a/x/wasm/internal/keeper/keeper_test.go +++ b/x/wasm/internal/keeper/keeper_test.go @@ -203,7 +203,7 @@ func TestInstantiate(t *testing.T) { require.Equal(t, "cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5", addr.String()) gasAfter := ctx.GasMeter().GasConsumed() - require.Equal(t, uint64(0x11536), gasAfter-gasBefore) + require.Equal(t, uint64(0x1153c), gasAfter-gasBefore) // ensure it is stored properly info := keeper.GetContractInfo(ctx, addr) @@ -298,7 +298,7 @@ func TestExecute(t *testing.T) { // make sure gas is properly deducted from ctx gasAfter := ctx.GasMeter().GasConsumed() - require.Equal(t, uint64(0x11bef), gasAfter-gasBefore) + require.Equal(t, uint64(0x1130a), gasAfter-gasBefore) // ensure bob now exists and got both payments released bobAcct = accKeeper.GetAccount(ctx, bob) @@ -592,11 +592,11 @@ func TestMigrateWithDispatchedMessage(t *testing.T) { require.NoError(t, err) defer os.RemoveAll(tempDir) ctx, keepers := CreateTestInput(t, false, tempDir, SupportedFeatures, nil, nil) - accKeeper, keeper := keepers.AccountKeeper, keepers.WasmKeeper + accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.WasmKeeper, keepers.BankKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := createFakeFundedAccount(ctx, accKeeper, deposit.Add(deposit...)) - fred := createFakeFundedAccount(ctx, accKeeper, sdk.NewCoins(sdk.NewInt64Coin("denom", 5000))) + creator := createFakeFundedAccount(t, ctx, accKeeper, bankKeeper, deposit.Add(deposit...)) + fred := createFakeFundedAccount(t, ctx, accKeeper, bankKeeper, sdk.NewCoins(sdk.NewInt64Coin("denom", 5000))) wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm") require.NoError(t, err) @@ -645,7 +645,7 @@ func TestMigrateWithDispatchedMessage(t *testing.T) { "Type": "transfer", "Attr": []dict{ {"recipient": myPayoutAddr}, - {"sender": contractAddr}, + //{"sender": contractAddr}, {"amount": "100000denom"}, }, }, @@ -670,7 +670,7 @@ func TestMigrateWithDispatchedMessage(t *testing.T) { require.Len(t, m, 0) // and all deposit tokens sent to myPayoutAddr - balance := accKeeper.GetAccount(ctx, myPayoutAddr).GetCoins() + balance := bankKeeper.GetAllBalances(ctx, myPayoutAddr) assert.Equal(t, deposit, balance) } @@ -779,12 +779,12 @@ func TestClearContractAdmin(t *testing.T) { require.NoError(t, err) defer os.RemoveAll(tempDir) ctx, keepers := CreateTestInput(t, false, tempDir, SupportedFeatures, nil, nil) - accKeeper, keeper := keepers.AccountKeeper, keepers.WasmKeeper + accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.WasmKeeper, keepers.BankKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)) - creator := createFakeFundedAccount(ctx, accKeeper, deposit.Add(deposit...)) - fred := createFakeFundedAccount(ctx, accKeeper, topUp) + creator := createFakeFundedAccount(t, ctx, accKeeper, bankKeeper, deposit.Add(deposit...)) + fred := createFakeFundedAccount(t, ctx, accKeeper, bankKeeper, topUp) wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm") require.NoError(t, err) diff --git a/x/wasm/internal/keeper/test_common.go b/x/wasm/internal/keeper/test_common.go index b896f1e0e7..7389563576 100644 --- a/x/wasm/internal/keeper/test_common.go +++ b/x/wasm/internal/keeper/test_common.go @@ -227,5 +227,5 @@ func handleExecute(ctx sdk.Context, k Keeper, msg *wasmTypes.MsgExecuteContract) } res.Events = ctx.EventManager().Events().ToABCIEvents() - return &res, nil + return res, nil } diff --git a/x/wasm/internal/types/genesis.go b/x/wasm/internal/types/genesis.go index 5b198bbe72..3475f635a4 100644 --- a/x/wasm/internal/types/genesis.go +++ b/x/wasm/internal/types/genesis.go @@ -67,7 +67,7 @@ func (c Code) ValidateBasic() error { // Contract struct encompasses ContractAddress, ContractInfo, and ContractState type Contract struct { ContractAddress sdk.AccAddress `json:"contract_address"` - ContractInfo *ContractInfo `json:"contract_info"` + ContractInfo ContractInfo `json:"contract_info"` ContractState []Model `json:"contract_state"` } diff --git a/x/wasm/internal/types/msg.go b/x/wasm/internal/types/msg.go index d0cd8aff1b..a75118c4fc 100644 --- a/x/wasm/internal/types/msg.go +++ b/x/wasm/internal/types/msg.go @@ -1,8 +1,6 @@ package types import ( - "encoding/json" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -142,7 +140,7 @@ func (msg MsgMigrateContract) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.Sender} } -func (msg MsgUpdateAdministrator) Route() string { +func (msg MsgUpdateAdmin) Route() string { return RouterKey } @@ -174,11 +172,6 @@ func (msg MsgUpdateAdmin) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.Sender} } -type MsgClearAdmin struct { - Sender sdk.AccAddress `json:"sender" yaml:"sender"` - Contract sdk.AccAddress `json:"contract" yaml:"contract"` -} - func (msg MsgClearAdmin) Route() string { return RouterKey } diff --git a/x/wasm/internal/types/msg_test.go b/x/wasm/internal/types/msg_test.go index f18346ad87..acee87092e 100644 --- a/x/wasm/internal/types/msg_test.go +++ b/x/wasm/internal/types/msg_test.go @@ -211,7 +211,7 @@ func TestInstantiateContractValidation(t *testing.T) { } } -func TestMsgUpdateAdministrator(t *testing.T) { +func TestMsgUpdateAdmin(t *testing.T) { badAddress, err := sdk.AccAddressFromHex("012345") require.NoError(t, err) // proper address size diff --git a/x/wasm/internal/types/types.go b/x/wasm/internal/types/types.go index ff2eb9205e..0eee5d20cf 100644 --- a/x/wasm/internal/types/types.go +++ b/x/wasm/internal/types/types.go @@ -1,10 +1,10 @@ package types import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - tmBytes "github.com/tendermint/tendermint/libs/bytes" wasmTypes "github.com/CosmWasm/go-cosmwasm/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + tmBytes "github.com/tendermint/tendermint/libs/bytes" ) const defaultLRUCacheSize = uint64(0) @@ -172,21 +172,25 @@ const CustomEventType = "wasm" const AttributeKeyContractAddr = "contract_address" // CosmosResult converts from a Wasm Result type -func CosmosResult(wasmResult wasmTypes.Result, contractAddr sdk.AccAddress) ([]byte, sdk.Events) { - var events sdk.Events - if len(wasmResult.Log) > 0 { - // we always tag with the contract address issuing this event - attrs := []sdk.Attribute{sdk.NewAttribute(AttributeKeyContractAddr, contractAddr.String())} - for _, l := range wasmResult.Log { - // and reserve the contract_address key for our use (not contract) - if l.Key != AttributeKeyContractAddr { - attr := sdk.NewAttribute(l.Key, l.Value) - attrs = append(attrs, attr) - } +func CosmosResult(wasmResult wasmTypes.HandleResponse, contractAddr sdk.AccAddress) ([]byte, sdk.Events) { + return wasmResult.Data, ConvertToEvents(wasmResult.Log, contractAddr) +} + +// ConvertToEvents converts wasm type LogAttribute to cosmos sdk events +func ConvertToEvents(log []wasmTypes.LogAttribute, contractAddr sdk.AccAddress) sdk.Events { + if len(log) == 0 { + return nil + } + // we always tag with the contract address issuing this event + attrs := []sdk.Attribute{sdk.NewAttribute(AttributeKeyContractAddr, contractAddr.String())} + for _, l := range log { + // and reserve the contract_address key for our use (not contract) + if l.Key != AttributeKeyContractAddr { + attr := sdk.NewAttribute(l.Key, l.Value) + attrs = append(attrs, attr) } - events = sdk.Events{sdk.NewEvent(CustomEventType, attrs...)} } - return []byte(wasmResult.Data), events + return sdk.Events{sdk.NewEvent(CustomEventType, attrs...)} } // WasmConfig is the extra config required for wasm diff --git a/x/wasm/internal/types/types.pb.go b/x/wasm/internal/types/types.pb.go index c50e4a8d90..1ec399e50b 100644 --- a/x/wasm/internal/types/types.pb.go +++ b/x/wasm/internal/types/types.pb.go @@ -192,24 +192,24 @@ func (m *MsgMigrateContract) XXX_DiscardUnknown() { var xxx_messageInfo_MsgMigrateContract proto.InternalMessageInfo -type MsgUpdateAdministrator struct { +type MsgUpdateAdmin struct { Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"` NewAdmin github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=new_admin,json=newAdmin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"new_admin,omitempty"` Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"` } -func (m *MsgUpdateAdministrator) Reset() { *m = MsgUpdateAdministrator{} } -func (m *MsgUpdateAdministrator) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateAdministrator) ProtoMessage() {} -func (*MsgUpdateAdministrator) Descriptor() ([]byte, []int) { +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_45de2b3fc8aff6aa, []int{4} } -func (m *MsgUpdateAdministrator) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateAdmin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdateAdministrator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdateAdministrator.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateAdmin.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -219,17 +219,55 @@ func (m *MsgUpdateAdministrator) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *MsgUpdateAdministrator) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateAdministrator.Merge(m, src) +func (m *MsgUpdateAdmin) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateAdmin.Merge(m, src) } -func (m *MsgUpdateAdministrator) XXX_Size() int { +func (m *MsgUpdateAdmin) XXX_Size() int { return m.Size() } -func (m *MsgUpdateAdministrator) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateAdministrator.DiscardUnknown(m) +func (m *MsgUpdateAdmin) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateAdmin.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdateAdministrator proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateAdmin proto.InternalMessageInfo + +type MsgClearAdmin struct { + Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"` + Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"` +} + +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_45de2b3fc8aff6aa, []int{5} +} +func (m *MsgClearAdmin) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClearAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClearAdmin.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 *MsgClearAdmin) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClearAdmin.Merge(m, src) +} +func (m *MsgClearAdmin) XXX_Size() int { + return m.Size() +} +func (m *MsgClearAdmin) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClearAdmin.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClearAdmin proto.InternalMessageInfo // CodeInfo is data for the uploaded contract WASM code type CodeInfo struct { @@ -243,7 +281,7 @@ func (m *CodeInfo) Reset() { *m = CodeInfo{} } func (m *CodeInfo) String() string { return proto.CompactTextString(m) } func (*CodeInfo) ProtoMessage() {} func (*CodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_45de2b3fc8aff6aa, []int{5} + return fileDescriptor_45de2b3fc8aff6aa, []int{6} } func (m *CodeInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -290,7 +328,7 @@ func (m *ContractInfo) Reset() { *m = ContractInfo{} } func (m *ContractInfo) String() string { return proto.CompactTextString(m) } func (*ContractInfo) ProtoMessage() {} func (*ContractInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_45de2b3fc8aff6aa, []int{6} + return fileDescriptor_45de2b3fc8aff6aa, []int{7} } func (m *ContractInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -331,7 +369,7 @@ func (m *AbsoluteTxPosition) Reset() { *m = AbsoluteTxPosition{} } func (m *AbsoluteTxPosition) String() string { return proto.CompactTextString(m) } func (*AbsoluteTxPosition) ProtoMessage() {} func (*AbsoluteTxPosition) Descriptor() ([]byte, []int) { - return fileDescriptor_45de2b3fc8aff6aa, []int{7} + return fileDescriptor_45de2b3fc8aff6aa, []int{8} } func (m *AbsoluteTxPosition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -379,7 +417,8 @@ func init() { proto.RegisterType((*MsgInstantiateContract)(nil), "wasmd.x.wasmd.v1.MsgInstantiateContract") proto.RegisterType((*MsgExecuteContract)(nil), "wasmd.x.wasmd.v1.MsgExecuteContract") proto.RegisterType((*MsgMigrateContract)(nil), "wasmd.x.wasmd.v1.MsgMigrateContract") - proto.RegisterType((*MsgUpdateAdministrator)(nil), "wasmd.x.wasmd.v1.MsgUpdateAdministrator") + proto.RegisterType((*MsgUpdateAdmin)(nil), "wasmd.x.wasmd.v1.MsgUpdateAdmin") + proto.RegisterType((*MsgClearAdmin)(nil), "wasmd.x.wasmd.v1.MsgClearAdmin") proto.RegisterType((*CodeInfo)(nil), "wasmd.x.wasmd.v1.CodeInfo") proto.RegisterType((*ContractInfo)(nil), "wasmd.x.wasmd.v1.ContractInfo") proto.RegisterType((*AbsoluteTxPosition)(nil), "wasmd.x.wasmd.v1.AbsoluteTxPosition") @@ -388,58 +427,60 @@ func init() { func init() { proto.RegisterFile("x/wasm/internal/types/types.proto", fileDescriptor_45de2b3fc8aff6aa) } var fileDescriptor_45de2b3fc8aff6aa = []byte{ - // 816 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xcd, 0x6e, 0xeb, 0x44, - 0x14, 0x8e, 0xeb, 0xfc, 0x4e, 0xa2, 0xaa, 0x0c, 0xe8, 0xca, 0x5c, 0x50, 0x9c, 0x7b, 0x41, 0x28, - 0x9b, 0x6b, 0xb7, 0x45, 0x02, 0x09, 0x01, 0x52, 0x52, 0xa0, 0x0d, 0xc8, 0xa8, 0x72, 0x41, 0x95, - 0xd8, 0x58, 0x13, 0xcf, 0xd4, 0x19, 0x9a, 0xcc, 0x44, 0x9e, 0x71, 0xe3, 0xbc, 0x41, 0x97, 0x2c, - 0x78, 0x00, 0xd6, 0x88, 0x07, 0x29, 0xac, 0xba, 0x64, 0x15, 0x50, 0x2a, 0x36, 0x3c, 0x42, 0x57, - 0x68, 0xc6, 0x76, 0x69, 0xe9, 0x82, 0x92, 0x86, 0xc5, 0xdd, 0x64, 0x72, 0x3c, 0xe7, 0x7c, 0x3e, - 0xdf, 0x77, 0xe6, 0x1c, 0x0f, 0x78, 0x96, 0xba, 0x33, 0x24, 0x26, 0x2e, 0x65, 0x92, 0xc4, 0x0c, - 0x8d, 0x5d, 0x39, 0x9f, 0x12, 0x91, 0xfd, 0x3a, 0xd3, 0x98, 0x4b, 0x0e, 0xb7, 0x94, 0x03, 0x76, - 0x52, 0x27, 0x5b, 0xcf, 0x76, 0x9e, 0xbe, 0x23, 0x47, 0x34, 0xc6, 0xc1, 0x14, 0xc5, 0x72, 0xee, - 0x6a, 0x27, 0x37, 0xe2, 0x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f5, 0x06, 0x7c, 0x0d, - 0x54, 0xc6, 0x68, 0x48, 0xc6, 0x39, 0xdb, 0xcc, 0x80, 0xef, 0x83, 0x3a, 0x65, 0x54, 0x06, 0x13, - 0x11, 0x59, 0x15, 0x9d, 0xc2, 0x9b, 0xd7, 0x0b, 0xdb, 0x22, 0x2c, 0xe4, 0x98, 0xb2, 0xc8, 0xfd, - 0x56, 0x70, 0xe6, 0xf8, 0x68, 0xe6, 0x11, 0x21, 0x50, 0x44, 0xfc, 0x9a, 0xf2, 0xf6, 0x44, 0x04, - 0x31, 0x00, 0x3a, 0xf0, 0x24, 0x61, 0x58, 0x58, 0xd5, 0x8e, 0xd9, 0x6d, 0xee, 0xbe, 0xea, 0x64, - 0x89, 0x06, 0x02, 0x9f, 0x3a, 0x67, 0x3b, 0xce, 0x1e, 0xa7, 0xac, 0xbf, 0x7d, 0xb1, 0xb0, 0x4b, - 0x3f, 0xfe, 0x66, 0x77, 0x1f, 0x40, 0x4b, 0x05, 0x08, 0xbf, 0xa1, 0x80, 0x3f, 0x53, 0xb8, 0x79, - 0x29, 0x7e, 0xd9, 0x00, 0xd0, 0x13, 0xd1, 0xa7, 0x29, 0x09, 0x93, 0xff, 0xa7, 0x0c, 0x1e, 0xa8, - 0x87, 0x39, 0xec, 0xea, 0x95, 0xb8, 0x81, 0x80, 0x0e, 0x30, 0x95, 0xa0, 0xe6, 0x03, 0x04, 0x55, - 0x8e, 0x4a, 0x4c, 0x41, 0x58, 0x21, 0x66, 0x65, 0xad, 0x62, 0x2a, 0xe0, 0xdb, 0x62, 0x7e, 0x9f, - 0x89, 0xe9, 0xd1, 0x28, 0x46, 0x2f, 0x85, 0x98, 0xff, 0x7a, 0xb2, 0x3f, 0x02, 0xcd, 0x49, 0xc6, - 0x46, 0x1f, 0xe3, 0xf2, 0x03, 0x54, 0x07, 0x79, 0x80, 0x27, 0xa2, 0xa2, 0xdd, 0x37, 0x74, 0xbb, - 0x7f, 0x3d, 0xc5, 0x48, 0x92,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 0xbe, 0x97, 0xd7, 0x68, - 0x73, 0x7a, 0xdb, 0xc6, 0x79, 0x9d, 0x7d, 0x00, 0xef, 0xbf, 0x06, 0x3e, 0x03, 0xad, 0xe1, 0x98, - 0x87, 0xa7, 0xc1, 0x88, 0xd0, 0x68, 0x24, 0x75, 0xc5, 0x4d, 0xbf, 0xa9, 0x9f, 0x1d, 0xe8, 0x47, - 0xf0, 0x75, 0x50, 0x97, 0x69, 0x40, 0x19, 0x26, 0xa9, 0xae, 0x75, 0xd9, 0xaf, 0xc9, 0x74, 0xa0, - 0xcc, 0xfe, 0xe7, 0x17, 0xcb, 0xb6, 0x71, 0xb9, 0x6c, 0x1b, 0xbf, 0x2f, 0xdb, 0xc6, 0x77, 0x57, - 0xed, 0xd2, 0xe5, 0x55, 0xbb, 0xf4, 0xeb, 0x55, 0xbb, 0xf4, 0xcd, 0xf6, 0xad, 0xfa, 0xed, 0x71, - 0x31, 0x39, 0x56, 0xf7, 0x28, 0xcd, 0xd7, 0x4d, 0xf3, 0xf5, 0xee, 0xad, 0x6a, 0x58, 0xd5, 0x77, - 0xa0, 0x77, 0xff, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x3c, 0x07, 0xcf, 0x87, 0x75, 0x09, 0x00, 0x00, + // 834 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x41, 0x8f, 0x1b, 0x35, + 0x14, 0xce, 0xec, 0x64, 0x93, 0xec, 0x4b, 0x58, 0x2d, 0x06, 0x55, 0x43, 0x41, 0x99, 0x6d, 0x41, + 0x28, 0x97, 0x4e, 0xba, 0x45, 0x02, 0x09, 0x01, 0x52, 0xb2, 0x40, 0x1b, 0xd0, 0xa0, 0x6a, 0x0a, + 0xaa, 0xc4, 0x65, 0xe4, 0x8c, 0xdd, 0x89, 0xd9, 0xc4, 0x8e, 0xe6, 0x39, 0xbb, 0xd9, 0x1b, 0xc7, + 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, 0xe5, 0xac, 0x5d, 0xf9, 0xf2, 0xe6, 0x39, 0xff, 0x0e, + 0x15, 0x4e, 0xee, 0x9b, 0x1b, 0x9f, 0xed, 0xb7, 0x3b, 0x77, 0xe3, 0xdf, 0xef, 0x7f, 0xc3, 0x9a, + 0xbd, 0xad, 0xbd, 0xf5, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x78, 0x15, 0xad, 0x1f, 0x0a, + 0x00, 0x00, } func (m *MsgStoreCode) Marshal() (dAtA []byte, err error) { @@ -670,7 +711,7 @@ func (m *MsgMigrateContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateAdministrator) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateAdmin) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -680,12 +721,12 @@ func (m *MsgUpdateAdministrator) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateAdministrator) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateAdmin) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateAdministrator) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateAdmin) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -714,6 +755,43 @@ func (m *MsgUpdateAdministrator) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgClearAdmin) 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 *MsgClearAdmin) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClearAdmin) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Contract) > 0 { + i -= len(m.Contract) + copy(dAtA[i:], m.Contract) + i = encodeVarintTypes(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 = encodeVarintTypes(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *CodeInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1004,7 +1082,7 @@ func (m *MsgMigrateContract) Size() (n int) { return n } -func (m *MsgUpdateAdministrator) Size() (n int) { +func (m *MsgUpdateAdmin) Size() (n int) { if m == nil { return 0 } @@ -1025,6 +1103,23 @@ func (m *MsgUpdateAdministrator) Size() (n int) { return n } +func (m *MsgClearAdmin) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Contract) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + func (m *CodeInfo) Size() (n int) { if m == nil { return 0 @@ -1898,7 +1993,7 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateAdministrator) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1921,10 +2016,10 @@ func (m *MsgUpdateAdministrator) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateAdministrator: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateAdmin: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateAdministrator: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateAdmin: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2053,6 +2148,127 @@ func (m *MsgUpdateAdministrator) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgClearAdmin) 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 ErrIntOverflowTypes + } + 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: MsgClearAdmin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClearAdmin: 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 byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = append(m.Sender[:0], dAtA[iNdEx:postIndex]...) + if m.Sender == nil { + m.Sender = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contract = append(m.Contract[:0], dAtA[iNdEx:postIndex]...) + if m.Contract == nil { + m.Contract = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *CodeInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/wasm/internal/types/types.proto b/x/wasm/internal/types/types.proto index df5ce52569..75a2921c70 100644 --- a/x/wasm/internal/types/types.proto +++ b/x/wasm/internal/types/types.proto @@ -54,7 +54,7 @@ message MsgMigrateContract{ bytes migrate_msg = 4 [(gogoproto.casttype) = "encoding/json.RawMessage"]; } -message MsgUpdateAdministrator{ +message MsgUpdateAdmin{ option (gogoproto.goproto_getters) = false; bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; @@ -62,6 +62,13 @@ message MsgUpdateAdministrator{ bytes contract = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; } +message MsgClearAdmin{ + option (gogoproto.goproto_getters) = false; + + bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + bytes contract = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; +} + // CodeInfo is data for the uploaded contract WASM code message CodeInfo { option (gogoproto.goproto_getters) = false;