-
Notifications
You must be signed in to change notification settings - Fork 64
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 #67 from oracleNetworkProtocol/worry-free
docs
- Loading branch information
Showing
8 changed files
with
164 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
order: 7 | ||
--- | ||
|
||
## Events | ||
Values that describe different events | ||
|
||
## message.module | ||
- bank | ||
- distribution | ||
- governance | ||
- staking | ||
- slashing | ||
- token | ||
- transfer | ||
- evm | ||
- liquidity | ||
- ibc_client | ||
- ibc_channel | ||
- ibc_connection | ||
|
||
|
||
## message.action | ||
- /cosmos.bank.v1beta1.MsgSend | ||
- /cosmos.bank.v1beta1.MsgMultiSend | ||
- /cosmos.distribution.v1beta1.MsgFundCommunityPool | ||
- /cosmos.distribution.v1beta1.MsgSetWithdrawAddress | ||
- /cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward | ||
- /cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission | ||
- /cosmos.gov.v1beta1.MsgVote | ||
<!-- - /cosmos.gov.v1beta1.MsgVoteWeighted | ||
- /cosmos.gov.v1beta1.MsgSubmitProposal | ||
- /cosmos.gov.v1beta1.MsgDeposit --> | ||
- /cosmos.slashing.v1beta1.MsgUnjail | ||
- /cosmos.staking.v1beta1.MsgBeginRedelegate | ||
- /cosmos.staking.v1beta1.MsgCreateValidator | ||
- /cosmos.staking.v1beta1.MsgDelegate | ||
- /cosmos.staking.v1beta1.MsgEditValidator | ||
- /cosmos.staking.v1beta1.MsgUndelegate | ||
- /ethermint.evm.v1.MsgEthereumTx | ||
- /ibc.applications.transfer.v1.MsgTransfer | ||
- /ibc.core.client.v1.MsgCreateClient | ||
- /ibc.core.channel.v1.MsgAcknowledgement | ||
- /ibc.core.channel.v1.MsgChannelOpenAck | ||
- /ibc.core.channel.v1.MsgChannelOpenInit | ||
- /ibc.core.channel.v1.MsgRecvPacket | ||
- /ibc.core.channel.v1.MsgTimeout | ||
- /ibc.core.connection.v1.MsgConnectionOpenAck | ||
- /ibc.core.connection.v1.MsgConnectionOpenInit | ||
- /plugchain.prc10.MsgBurnToken | ||
- /plugchain.prc10.MsgEditToken | ||
- /plugchain.prc10.MsgIssueToken | ||
- /plugchain.prc10.MsgMintToken | ||
- /tendermint.liquidity.v1beta1.MsgCreatePool | ||
- /tendermint.liquidity.v1beta1.MsgDepositWithinBatch | ||
- /tendermint.liquidity.v1beta1.MsgSwapWithinBatch | ||
- /tendermint.liquidity.v1beta1.MsgWithdrawWithinBatch |
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,58 @@ | ||
--- | ||
order: 7 | ||
--- | ||
|
||
## Events | ||
|
||
描述不同事件的值 | ||
|
||
## message.module | ||
- bank | ||
- distribution | ||
- governance | ||
- staking | ||
- slashing | ||
- token | ||
- transfer | ||
- evm | ||
- liquidity | ||
- ibc_client | ||
- ibc_channel | ||
- ibc_connection | ||
|
||
|
||
## message.action | ||
- /cosmos.bank.v1beta1.MsgSend | ||
- /cosmos.bank.v1beta1.MsgMultiSend | ||
- /cosmos.distribution.v1beta1.MsgFundCommunityPool | ||
- /cosmos.distribution.v1beta1.MsgSetWithdrawAddress | ||
- /cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward | ||
- /cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission | ||
- /cosmos.gov.v1beta1.MsgVote | ||
<!-- - /cosmos.gov.v1beta1.MsgVoteWeighted | ||
- /cosmos.gov.v1beta1.MsgSubmitProposal | ||
- /cosmos.gov.v1beta1.MsgDeposit --> | ||
- /cosmos.slashing.v1beta1.MsgUnjail | ||
- /cosmos.staking.v1beta1.MsgBeginRedelegate | ||
- /cosmos.staking.v1beta1.MsgCreateValidator | ||
- /cosmos.staking.v1beta1.MsgDelegate | ||
- /cosmos.staking.v1beta1.MsgEditValidator | ||
- /cosmos.staking.v1beta1.MsgUndelegate | ||
- /ethermint.evm.v1.MsgEthereumTx | ||
- /ibc.applications.transfer.v1.MsgTransfer | ||
- /ibc.core.client.v1.MsgCreateClient | ||
- /ibc.core.channel.v1.MsgAcknowledgement | ||
- /ibc.core.channel.v1.MsgChannelOpenAck | ||
- /ibc.core.channel.v1.MsgChannelOpenInit | ||
- /ibc.core.channel.v1.MsgRecvPacket | ||
- /ibc.core.channel.v1.MsgTimeout | ||
- /ibc.core.connection.v1.MsgConnectionOpenAck | ||
- /ibc.core.connection.v1.MsgConnectionOpenInit | ||
- /plugchain.prc10.MsgBurnToken | ||
- /plugchain.prc10.MsgEditToken | ||
- /plugchain.prc10.MsgIssueToken | ||
- /plugchain.prc10.MsgMintToken | ||
- /tendermint.liquidity.v1beta1.MsgCreatePool | ||
- /tendermint.liquidity.v1beta1.MsgDepositWithinBatch | ||
- /tendermint.liquidity.v1beta1.MsgSwapWithinBatch | ||
- /tendermint.liquidity.v1beta1.MsgWithdrawWithinBatch |
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
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,31 @@ | ||
package types | ||
|
||
import ( | ||
"strings" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | ||
) | ||
|
||
// GeGxAddressFromBech32 returns the sdk.Account address of given address, | ||
// while also changing bech32 human readable prefix (HRP) to the value set on | ||
// the global sdk.Config (eg: `gx`). | ||
// The function fails if the provided bech32 address is invalid. | ||
func GetGxAddressFromBech32(address string) (sdk.AccAddress, error) { | ||
bech32Prefix := strings.SplitN(address, "1", 2)[0] | ||
if bech32Prefix == address { | ||
return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid bech32 address: %s", address) | ||
} | ||
|
||
addressBz, err := sdk.GetFromBech32(address, bech32Prefix) | ||
if err != nil { | ||
return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid address %s, %s", address, err.Error()) | ||
} | ||
|
||
// safety check: shouldn't happen | ||
if err := sdk.VerifyAddressFormat(addressBz); err != nil { | ||
return nil, err | ||
} | ||
|
||
return sdk.AccAddress(addressBz), nil | ||
} |