-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1943 from CosmWasm/go-gen-fixes
go-gen fixes
- Loading branch information
Showing
7 changed files
with
347 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SendMsg contains instructions for a Cosmos-SDK/SendMsg | ||
// It has a fixed interface here and should be converted into the proper SDK format before dispatching | ||
type SendMsg struct { | ||
Amount []Coin `json:"amount"` | ||
ToAddress string `json:"to_address"` | ||
} | ||
|
||
// BurnMsg will burn the given coins from the contract's account. | ||
// There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. | ||
// Important if a contract controls significant token supply that must be retired. | ||
type BurnMsg struct { | ||
Amount []Coin `json:"amount"` | ||
} | ||
|
||
type BankMsg struct { | ||
Send *SendMsg `json:"send,omitempty"` | ||
Burn *BurnMsg `json:"burn,omitempty"` | ||
} | ||
|
||
// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) | ||
type Coin struct { | ||
Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" | ||
Denom string `json:"denom"` // type, eg. "ATOM" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SetWithdrawAddressMsg is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). | ||
// `delegator_address` is automatically filled with the current contract's address. | ||
type SetWithdrawAddressMsg struct { | ||
// Address contains the `delegator_address` of a MsgSetWithdrawAddress | ||
Address string `json:"address"` | ||
} | ||
|
||
// WithdrawDelegatorRewardMsg is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). | ||
// `delegator_address` is automatically filled with the current contract's address. | ||
type WithdrawDelegatorRewardMsg struct { | ||
// Validator contains `validator_address` of a MsgWithdrawDelegatorReward | ||
Validator string `json:"validator"` | ||
} | ||
|
||
// FundCommunityPoolMsg is translated to a [MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). | ||
// `depositor` is automatically filled with the current contract's address | ||
type FundCommunityPoolMsg struct { | ||
// Amount is the list of coins to be send to the community pool | ||
Amount []Coin `json:"amount"` | ||
} | ||
|
||
type DistributionMsg struct { | ||
SetWithdrawAddress *SetWithdrawAddressMsg `json:"set_withdraw_address,omitempty"` | ||
WithdrawDelegatorReward *WithdrawDelegatorRewardMsg `json:"withdraw_delegator_reward,omitempty"` | ||
FundCommunityPool *FundCommunityPoolMsg `json:"fund_community_pool,omitempty"` | ||
} | ||
|
||
// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) | ||
type Coin struct { | ||
Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" | ||
Denom string `json:"denom"` // type, eg. "ATOM" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
type TransferMsg struct { | ||
Amount Coin `json:"amount"` | ||
ChannelID string `json:"channel_id"` | ||
Memo string `json:"memo,omitempty"` // this is not yet in wasmvm, but will be soon | ||
Timeout IBCTimeout `json:"timeout"` | ||
ToAddress string `json:"to_address"` | ||
} | ||
type SendPacketMsg struct { | ||
ChannelID string `json:"channel_id"` | ||
Data []byte `json:"data"` | ||
Timeout IBCTimeout `json:"timeout"` | ||
} | ||
type CloseChannelMsg struct { | ||
ChannelID string `json:"channel_id"` | ||
} | ||
|
||
type IBCMsg struct { | ||
Transfer *TransferMsg `json:"transfer,omitempty"` | ||
SendPacket *SendPacketMsg `json:"send_packet,omitempty"` | ||
CloseChannel *CloseChannelMsg `json:"close_channel,omitempty"` | ||
} | ||
|
||
// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) | ||
type Coin struct { | ||
Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" | ||
Denom string `json:"denom"` // type, eg. "ATOM" | ||
} | ||
|
||
// IBCTimeout is the timeout for an IBC packet. At least one of block and timestamp is required. | ||
type IBCTimeout struct { | ||
Block *IBCTimeoutBlock `json:"block,omitempty"` // in wasmvm, this does not have "omitempty" | ||
// Nanoseconds since UNIX epoch | ||
Timestamp *Uint64 `json:"timestamp,omitempty"` | ||
} | ||
|
||
// IBCTimeoutBlock Height is a monotonically increasing data type | ||
// that can be compared against another Height for the purposes of updating and | ||
// freezing clients. | ||
// Ordering is (revision_number, timeout_height) | ||
type IBCTimeoutBlock struct { | ||
// block height after which the packet times out. | ||
// the height within the given revision | ||
Height uint64 `json:"height"` | ||
// the version that the client is currently on | ||
// (eg. after reseting the chain this could increment 1 as height drops to 0) | ||
Revision uint64 `json:"revision"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
type DelegateMsg struct { | ||
Amount Coin `json:"amount"` | ||
Validator string `json:"validator"` | ||
} | ||
type UndelegateMsg struct { | ||
Amount Coin `json:"amount"` | ||
Validator string `json:"validator"` | ||
} | ||
type RedelegateMsg struct { | ||
Amount Coin `json:"amount"` | ||
DstValidator string `json:"dst_validator"` | ||
SrcValidator string `json:"src_validator"` | ||
} | ||
|
||
type StakingMsg struct { | ||
Delegate *DelegateMsg `json:"delegate,omitempty"` | ||
Undelegate *UndelegateMsg `json:"undelegate,omitempty"` | ||
Redelegate *RedelegateMsg `json:"redelegate,omitempty"` | ||
} | ||
|
||
// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) | ||
type Coin struct { | ||
Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" | ||
Denom string `json:"denom"` // type, eg. "ATOM" | ||
} |
Oops, something went wrong.