Skip to content

Commit

Permalink
feat: remove bank multisend msg (cosmos#274)
Browse files Browse the repository at this point in the history
* in progress

* in progress

* remove all code

* remove old error code comments

* edit comment

* removed Input and Output proto structs

* Delete deprecated comment

Co-authored-by: mattverse <[email protected]>
  • Loading branch information
sunnya97 and mattverse authored Jul 1, 2022
1 parent d0da4b4 commit 9165099
Show file tree
Hide file tree
Showing 23 changed files with 70 additions and 2,242 deletions.
2 changes: 1 addition & 1 deletion codec/types/interface_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type InterfaceRegistry interface {
// the interface iface.
//
// Ex:
// registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{})
// registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{})
RegisterImplementations(iface interface{}, impls ...proto.Message)

// ListAllInterfaces list the type URLs of all registered interfaces.
Expand Down
63 changes: 0 additions & 63 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@

- [cosmos/bank/v1beta1/bank.proto](#cosmos/bank/v1beta1/bank.proto)
- [DenomUnit](#cosmos.bank.v1beta1.DenomUnit)
- [Input](#cosmos.bank.v1beta1.Input)
- [Metadata](#cosmos.bank.v1beta1.Metadata)
- [Output](#cosmos.bank.v1beta1.Output)
- [Params](#cosmos.bank.v1beta1.Params)
- [SendEnabled](#cosmos.bank.v1beta1.SendEnabled)
- [Supply](#cosmos.bank.v1beta1.Supply)
Expand Down Expand Up @@ -116,8 +114,6 @@
- [Query](#cosmos.bank.v1beta1.Query)

- [cosmos/bank/v1beta1/tx.proto](#cosmos/bank/v1beta1/tx.proto)
- [MsgMultiSend](#cosmos.bank.v1beta1.MsgMultiSend)
- [MsgMultiSendResponse](#cosmos.bank.v1beta1.MsgMultiSendResponse)
- [MsgSend](#cosmos.bank.v1beta1.MsgSend)
- [MsgSendResponse](#cosmos.bank.v1beta1.MsgSendResponse)

Expand Down Expand Up @@ -1588,22 +1584,6 @@ denomination unit of the basic token.



<a name="cosmos.bank.v1beta1.Input"></a>

### Input
Input models transaction input.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `address` | [string](#string) | | |
| `coins` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | |






<a name="cosmos.bank.v1beta1.Metadata"></a>

### Metadata
Expand All @@ -1629,22 +1609,6 @@ Since: cosmos-sdk 0.43 |



<a name="cosmos.bank.v1beta1.Output"></a>

### Output
Output models transaction outputs.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `address` | [string](#string) | | |
| `coins` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | |






<a name="cosmos.bank.v1beta1.Params"></a>

### Params
Expand Down Expand Up @@ -2131,32 +2095,6 @@ Query defines the gRPC querier service.



<a name="cosmos.bank.v1beta1.MsgMultiSend"></a>

### MsgMultiSend
MsgMultiSend represents an arbitrary multi-in, multi-out send message.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `inputs` | [Input](#cosmos.bank.v1beta1.Input) | repeated | |
| `outputs` | [Output](#cosmos.bank.v1beta1.Output) | repeated | |






<a name="cosmos.bank.v1beta1.MsgMultiSendResponse"></a>

### MsgMultiSendResponse
MsgMultiSendResponse defines the Msg/MultiSend response type.






<a name="cosmos.bank.v1beta1.MsgSend"></a>

### MsgSend
Expand Down Expand Up @@ -2198,7 +2136,6 @@ Msg defines the bank Msg service.
| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `Send` | [MsgSend](#cosmos.bank.v1beta1.MsgSend) | [MsgSendResponse](#cosmos.bank.v1beta1.MsgSendResponse) | Send defines a method for sending coins from one account to another account. | |
| `MultiSend` | [MsgMultiSend](#cosmos.bank.v1beta1.MsgMultiSend) | [MsgMultiSendResponse](#cosmos.bank.v1beta1.MsgMultiSendResponse) | MultiSend defines a method for sending coins from some accounts to other accounts. | |

<!-- end services -->

Expand Down
20 changes: 0 additions & 20 deletions proto/cosmos/bank/v1beta1/bank.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,6 @@ message SendEnabled {
bool enabled = 2;
}

// Input models transaction input.
message Input {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

string address = 1;
repeated cosmos.base.v1beta1.Coin coins = 2
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}

// Output models transaction outputs.
message Output {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

string address = 1;
repeated cosmos.base.v1beta1.Coin coins = 2
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}

// Supply represents a struct that passively keeps track of the total supply
// amounts in the network.
// This message is deprecated now that supply is indexed by denom.
Expand Down
14 changes: 0 additions & 14 deletions proto/cosmos/bank/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types";
service Msg {
// Send defines a method for sending coins from one account to another account.
rpc Send(MsgSend) returns (MsgSendResponse);

// MultiSend defines a method for sending coins from some accounts to other accounts.
rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse);
}

// MsgSend represents a message to send coins from one account to another.
Expand All @@ -29,14 +26,3 @@ message MsgSend {

// MsgSendResponse defines the Msg/Send response type.
message MsgSendResponse {}

// MsgMultiSend represents an arbitrary multi-in, multi-out send message.
message MsgMultiSend {
option (gogoproto.equal) = false;

repeated Input inputs = 1 [(gogoproto.nullable) = false];
repeated Output outputs = 2 [(gogoproto.nullable) = false];
}

// MsgMultiSendResponse defines the Msg/MultiSend response type.
message MsgMultiSendResponse {}
1 change: 0 additions & 1 deletion simapp/params/weights.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package params
// Default simulation operation weights for messages and gov proposals
const (
DefaultWeightMsgSend int = 100
DefaultWeightMsgMultiSend int = 10
DefaultWeightMsgSetWithdrawAddress int = 50
DefaultWeightMsgWithdrawDelegationReward int = 50
DefaultWeightMsgWithdrawValidatorCommission int = 50
Expand Down
3 changes: 2 additions & 1 deletion x/authz/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/authz"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
)

var bankSendAuthMsgType = banktypes.SendAuthorization{}.MsgTypeURL()
Expand Down Expand Up @@ -72,7 +73,7 @@ func (s *TestSuite) TestKeeper() {
s.Require().Equal(authorization.MsgTypeURL(), bankSendAuthMsgType)

s.T().Log("verify fetching authorization with wrong msg type fails")
authorization, _ = app.AuthzKeeper.GetCleanAuthorization(ctx, granteeAddr, granterAddr, sdk.MsgTypeURL(&banktypes.MsgMultiSend{}))
authorization, _ = app.AuthzKeeper.GetCleanAuthorization(ctx, granteeAddr, granterAddr, sdk.MsgTypeURL(&govtypes.MsgDeposit{}))
s.Require().Nil(authorization)

s.T().Log("verify fetching authorization with wrong grantee fails")
Expand Down
Loading

0 comments on commit 9165099

Please sign in to comment.