Documentation ¶
Index ¶
- Constants
- Variables
- func AppendMsgToErr(msg string, err string) string
- func Bech32ifyPubKey(pkt Bech32PubKeyType, pubkey crypto.PubKey) (string, error)
- func BigEndianToUint64(bz []byte) uint64
- func CopyBytes(bz []byte) (ret []byte)
- func DecEq(t *testing.T, exp, got Dec) (*testing.T, bool, string, string, string)
- func DecsEqual(d1s, d2s []Dec) bool
- func DefaultCoinDenomRegex() string
- func DefaultIBCCoinDenomRegex() string
- func Derive(address []byte, key []byte) []byte
- func DiffKVStores(a KVStore, b KVStore, prefixesToSkip [][]byte) (kvAs, kvBs []tmkv.Pair)
- func FormatInvariant(module, name, msg string) string
- func FormatTimeBytes(t time.Time) []byte
- func GetBaseDenom() (string, error)
- func GetFromBech32(bech32str, prefix string) ([]byte, error)
- func GetPubKeyFromBech32(pkt Bech32PubKeyType, pubkeyStr string) (crypto.PubKey, error)
- func Hash(typ string, key []byte) []byte
- func InclusiveEndBytes(inclusiveBytes []byte) (exclusiveBytes []byte)
- func IntEq(t *testing.T, exp, got Int) (*testing.T, bool, string, string, string)
- func IsETHAddress(addr string) bool
- func IsOKCAddress(addr string) bool
- func IsWasmAddress(acc AccAddress) bool
- func KeyringServiceName() string
- func MsgTypeURL(msg proto.Message) string
- func MustBech32ifyAccPub(pub crypto.PubKey) string
- func MustBech32ifyPubKey(pkt Bech32PubKeyType, pubkey crypto.PubKey) string
- func MustGetPubKeyFromBech32(pkt Bech32PubKeyType, pubkeyStr string) crypto.PubKey
- func MustSortJSON(toSortJSON []byte) []byte
- func NewDB(name, dir string) (db dbm.DB, err error)
- func NewKVStoreKeys(names ...string) map[string]*KVStoreKey
- func NewMemoryStoreKeys(names ...string) map[string]*MemoryStoreKey
- func NewTransientStoreKeys(names ...string) map[string]*TransientStoreKey
- func ParseTimeBytes(bz []byte) (time.Time, error)
- func PrefixEndBytes(prefix []byte) []byte
- func RegisterCodec(cdc *codec.Codec)
- func RegisterDenom(denom string, unit Dec) error
- func ReturnInfiniteGasMeter(gm ReusableGasMeter)
- func SetCoinDenomRegex(reFn func() string)
- func SetIBCCoinDenomRegex(reFn func() string)
- func SortJSON(toSortJSON []byte) ([]byte, error)
- func SortableDecBytes(dec Dec) []byte
- func TokensToConsensusPower(tokens Int) int64
- func Uint64ToBigEndian(i uint64) []byte
- func UintOverflow(i *big.Int) error
- func UnsafeBytesToStr(b []byte) string
- func UnsafeStrToBytes(s string) []byte
- func ValidCoins(coins Coins) bool
- func ValidSortableDec(dec Dec) bool
- func ValidateDenom(denom string) error
- func VerifyAddressFormat(bz []byte) error
- func WrapSDKContext(ctx Context) context.Context
- type ABCIMessageLog
- type ABCIMessageLogs
- type AccAddress
- func (aa AccAddress) Bech32String(bech32PrefixAccAddr string) string
- func (aa AccAddress) Bech32StringOptimized(bech32PrefixAccAddr string) string
- func (aa AccAddress) Bytes() []byte
- func (aa AccAddress) Empty() bool
- func (aa AccAddress) Equals(aa2 Address) bool
- func (aa AccAddress) Format(s fmt.State, verb rune)
- func (aa AccAddress) Marshal() ([]byte, error)
- func (aa AccAddress) MarshalJSON() ([]byte, error)
- func (aa AccAddress) MarshalYAML() (interface{}, error)
- func (aa AccAddress) String() string
- func (aa *AccAddress) Unmarshal(data []byte) error
- func (aa *AccAddress) UnmarshalJSON(data []byte) error
- func (aa *AccAddress) UnmarshalYAML(data []byte) error
- type AccNonceHandler
- type Account
- type AccountCache
- type Address
- type AnteDecorator
- type AnteHandler
- type Attribute
- type BaseTx
- func (tx *BaseTx) GetFrom() string
- func (tx *BaseTx) GetGas() uint64
- func (tx *BaseTx) GetGasPrice() *big.Int
- func (tx *BaseTx) GetMsgs() []Msg
- func (tx *BaseTx) GetNonce() uint64
- func (tx *BaseTx) GetRaw() []byte
- func (tx *BaseTx) GetSender(_ Context) string
- func (tx *BaseTx) GetSigners() []AccAddress
- func (tx *BaseTx) GetTxFnSignatureInfo() ([]byte, int)
- func (tx *BaseTx) GetType() TransactionType
- func (tx *BaseTx) SetRaw(raw []byte)
- func (tx *BaseTx) SetTxHash(hash []byte)
- func (tx *BaseTx) TxHash() []byte
- func (tx *BaseTx) ValidateBasic() error
- type Bech32PubKeyType
- type BeginBlocker
- type BondStatus
- type Cache
- func (c *Cache) DisableCache()
- func (c *Cache) GetAccount(addr ethcmn.Address) (Account, uint64, bool)
- func (c *Cache) GetCode(key []byte) ([]byte, bool)
- func (c *Cache) GetStorage(addr ethcmn.Address, key ethcmn.Hash) ([]byte, bool)
- func (c *Cache) IsEnabled() bool
- func (c *Cache) TryDelete(logger log.Logger, height int64)
- func (c *Cache) UpdateAccount(addr AccAddress, acc Account, lenBytes int, isDirty bool)
- func (c *Cache) UpdateCode(key []byte, value []byte, isdirty bool)
- func (c *Cache) UpdateStorage(addr ethcmn.Address, key ethcmn.Hash, value []byte, isDirty bool)
- func (c *Cache) Write(updateDirty bool)
- type CacheKVStore
- type CacheMultiStore
- type CacheWrap
- type CacheWrapper
- type Causer
- type Coder
- type Codespacer
- type Coin
- type CoinAdapter
- func (coin CoinAdapter) Add(coinB CoinAdapter) CoinAdapter
- func (coin CoinAdapter) AddAmount(amount Int) CoinAdapter
- func (*CoinAdapter) Descriptor() ([]byte, []int)
- func (this *CoinAdapter) Equal(that interface{}) bool
- func (m *CoinAdapter) GetDenom() string
- func (coin CoinAdapter) IsEqual(other CoinAdapter) bool
- func (coin CoinAdapter) IsGTE(other CoinAdapter) bool
- func (coin CoinAdapter) IsLT(other CoinAdapter) bool
- func (coin CoinAdapter) IsNegative() bool
- func (coin CoinAdapter) IsPositive() bool
- func (coin CoinAdapter) IsValid() bool
- func (coin CoinAdapter) IsZero() bool
- func (m *CoinAdapter) Marshal() (dAtA []byte, err error)
- func (m *CoinAdapter) MarshalTo(dAtA []byte) (int, error)
- func (m *CoinAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CoinAdapter) ProtoMessage()
- func (m *CoinAdapter) Reset()
- func (m *CoinAdapter) Size() (n int)
- func (coin CoinAdapter) String() string
- func (coin CoinAdapter) Sub(coinB CoinAdapter) CoinAdapter
- func (cs CoinAdapter) ToCoin() Coin
- func (m *CoinAdapter) Unmarshal(dAtA []byte) error
- func (coin CoinAdapter) Validate() error
- func (m *CoinAdapter) XXX_DiscardUnknown()
- func (m *CoinAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CoinAdapter) XXX_Merge(src proto.Message)
- func (m *CoinAdapter) XXX_Size() int
- func (m *CoinAdapter) XXX_Unmarshal(b []byte) error
- type CoinAdapters
- func (coins CoinAdapters) Add(coinsB ...CoinAdapter) CoinAdapters
- func (coins CoinAdapters) AmountOf(denom string) Int
- func (coins CoinAdapters) AmountOfNoDenomValidation(denom string) Int
- func (coins CoinAdapters) Copy() CoinAdapters
- func (coins CoinAdapters) IsAllPositive() bool
- func (cas CoinAdapters) IsAnyNegative() bool
- func (cas CoinAdapters) IsAnyNil() bool
- func (coins CoinAdapters) IsValid() bool
- func (coins CoinAdapters) IsZero() bool
- func (coins CoinAdapters) MarshalJSON() ([]byte, error)
- func (coins CoinAdapters) SafeSub(coinsB CoinAdapters) (CoinAdapters, bool)
- func (coins CoinAdapters) String() string
- func (coins CoinAdapters) Sub(coinsB CoinAdapters) CoinAdapters
- func (cs CoinAdapters) ToCoins() Coins
- func (coins CoinAdapters) Validate() error
- type Coins
- func (coins Coins) DenomsSubsetOf(coinsB Coins) bool
- func (coins Coins) IsAllGT(coinsB Coins) bool
- func (coins Coins) IsAllGTE(coinsB Coins) bool
- func (coins Coins) IsAllLT(coinsB Coins) bool
- func (coins Coins) IsAllLTE(coinsB Coins) bool
- func (coins Coins) IsAnyGT(coinsB Coins) bool
- func (coins Coins) IsAnyGTE(coinsB Coins) bool
- func (coins Coins) MarshalJSON() ([]byte, error)
- type CommitID
- type CommitKVStore
- type CommitMultiStore
- type CommitStore
- type Committer
- type Config
- func (config *Config) GetAddressVerifier() func([]byte) error
- func (config *Config) GetBech32AccountAddrPrefix() string
- func (config *Config) GetBech32AccountPubPrefix() string
- func (config *Config) GetBech32ConsensusAddrPrefix() string
- func (config *Config) GetBech32ConsensusPubPrefix() string
- func (config *Config) GetBech32ValidatorAddrPrefix() string
- func (config *Config) GetBech32ValidatorPubPrefix() string
- func (config *Config) GetCoinType() uint32
- func (config *Config) GetFullFundraiserPath() string
- func (config *Config) GetTxEncoder() TxEncoder
- func (config *Config) Seal() *Config
- func (config *Config) SetAddressVerifier(addressVerifier func([]byte) error)
- func (config *Config) SetBech32PrefixForAccount(addressPrefix, pubKeyPrefix string)
- func (config *Config) SetBech32PrefixForConsensusNode(addressPrefix, pubKeyPrefix string)
- func (config *Config) SetBech32PrefixForValidator(addressPrefix, pubKeyPrefix string)
- func (config *Config) SetCoinType(coinType uint32)
- func (config *Config) SetFullFundraiserPath(fullFundraiserPath string)
- func (config *Config) SetTxEncoder(encoder TxEncoder)
- type ConsAddress
- func (ca ConsAddress) Bytes() []byte
- func (ca ConsAddress) Empty() bool
- func (ca ConsAddress) Equals(ca2 Address) bool
- func (ca ConsAddress) Format(s fmt.State, verb rune)
- func (ca ConsAddress) Marshal() ([]byte, error)
- func (ca ConsAddress) MarshalJSON() ([]byte, error)
- func (ca ConsAddress) MarshalYAML() (interface{}, error)
- func (ca ConsAddress) String() string
- func (ca *ConsAddress) Unmarshal(data []byte) error
- func (ca *ConsAddress) UnmarshalJSON(data []byte) error
- func (ca *ConsAddress) UnmarshalYAML(data []byte) error
- type Context
- func (c *Context) AccountNonce() uint64
- func (c *Context) AnteTracer() *trace.Tracer
- func (c *Context) BlockGasMeter() GasMeter
- func (c *Context) BlockHeader() abci.Header
- func (c *Context) BlockHeight() int64
- func (c *Context) BlockProposerAddress() []byte
- func (c *Context) BlockTime() time.Time
- func (c *Context) Cache() *Cache
- func (c *Context) CacheContext() (cc Context, writeCache func())
- func (c *Context) ChainID() string
- func (c *Context) ConsensusParams() *abci.ConsensusParams
- func (c *Context) Context() context.Context
- func (c *Context) DisableAccountCache()
- func (c *Context) EnableAccountCache()
- func (c *Context) EventManager() *EventManager
- func (c *Context) From() string
- func (c *Context) GasMeter() GasMeter
- func (c Context) GetFeeSplitInfo() *FeeSplitInfo
- func (c *Context) GetFromAccountCacheData() interface{}
- func (c *Context) GetFromAccountCacheGas() Gas
- func (c *Context) GetReusableKVStore(key StoreKey) KVStore
- func (c *Context) GetToAccountCacheData() interface{}
- func (c *Context) GetToAccountCacheGas() Gas
- func (c *Context) GetWatcher() IWatcher
- func (c *Context) IsCheckTx() bool
- func (c *Context) IsDeliver() bool
- func (c *Context) IsReCheckTx() bool
- func (c *Context) IsTraceTx() bool
- func (c *Context) IsTraceTxLog() bool
- func (c *Context) IsWrappedCheckTx() bool
- func (c *Context) IsZero() bool
- func (c *Context) KVStore(key StoreKey) KVStore
- func (c *Context) Logger() log.Logger
- func (c *Context) MinGasPrices() DecCoins
- func (c *Context) MultiStore() MultiStore
- func (c *Context) OverrideBytes() []byte
- func (c Context) ParaMsg() *ParaMsg
- func (c *Context) ResetWatcher()
- func (_ *Context) ReturnKVStore(store KVStore)
- func (c *Context) SetAccountNonce(nonce uint64) *Context
- func (c *Context) SetAnteTracer(trc *trace.Tracer) *Context
- func (c *Context) SetBlockGasMeter(meter GasMeter) *Context
- func (c *Context) SetBlockHeader(header abci.Header) *Context
- func (c *Context) SetBlockHeight(height int64) *Context
- func (c *Context) SetBlockTime(newTime time.Time) *Context
- func (c *Context) SetCache(cache *Cache) *Context
- func (c *Context) SetChainID(chainID string) *Context
- func (c *Context) SetConsensusParams(params *abci.ConsensusParams) *Context
- func (c *Context) SetContext(ctx context.Context) *Context
- func (c *Context) SetDeliver() *Context
- func (c *Context) SetEventManager(em *EventManager) *Context
- func (c *Context) SetFeeSplitInfo(f *FeeSplitInfo) *Context
- func (c *Context) SetFrom(from string) *Context
- func (c *Context) SetGasMeter(meter GasMeter) *Context
- func (c *Context) SetIsCheckTx(isCheckTx bool) *Context
- func (c *Context) SetIsDeliverTx(isDeliverTx bool) *Context
- func (c *Context) SetIsReCheckTx(isRecheckTx bool) *Context
- func (c *Context) SetIsTraceTx(isTraceTx bool) *Context
- func (c *Context) SetIsTraceTxLog(isTraceTxLog bool) *Context
- func (c *Context) SetIsWrappedCheckTx(isWrappedCheckTx bool) *Context
- func (c *Context) SetLogger(logger log.Logger) *Context
- func (c *Context) SetMinGasPrices(gasPrices DecCoins) *Context
- func (c *Context) SetMultiStore(ms MultiStore) *Context
- func (c *Context) SetOverrideBytes(b []byte) *Context
- func (c *Context) SetParaMsg(m *ParaMsg) *Context
- func (c *Context) SetProposer(addr ConsAddress) *Context
- func (c *Context) SetTraceTxLogConfig(traceLogConfigBytes []byte) *Context
- func (c *Context) SetTxBytes(txBytes []byte) *Context
- func (c *Context) SetVoteInfos(voteInfo []abci.VoteInfo) *Context
- func (c *Context) SetWatcher(w IWatcher)
- func (c *Context) TraceTxLogConfig() []byte
- func (c *Context) TransientStore(key StoreKey) KVStore
- func (c *Context) TxBytes() []byte
- func (c *Context) UpdateFromAccountCache(fromAcc interface{}, fromAccGettedGas Gas)
- func (c *Context) UpdateToAccountCache(toAcc interface{}, toAccGotGas Gas)
- func (c *Context) UseParamCache() bool
- func (c Context) Value(key interface{}) interface{}
- func (c *Context) VoteInfos() []abci.VoteInfo
- func (c Context) WithBlockHeight(height int64) Context
- func (c Context) WithBlockTime(newTime time.Time) Context
- func (c Context) WithIsCheckTx(isCheckTx bool) Context
- func (c Context) WithIsReCheckTx(isRecheckTx bool) Context
- func (c Context) WithIsTraceTxLog(isTraceTxLog bool) Context
- func (c Context) WithValue(key, value interface{}) Context
- type ContextKey
- type CustomizeOnStop
- type Dec
- func GetDenomUnit(denom string) (Dec, bool)
- func MaxDec(d1, d2 Dec) Dec
- func MinDec(d1, d2 Dec) Dec
- func MustNewDecFromStr(s string) Dec
- func NewDec(i int64) Dec
- func NewDecFromBigInt(i *big.Int) Dec
- func NewDecFromBigIntWithPrec(i *big.Int, prec int64) Dec
- func NewDecFromInt(i Int) Dec
- func NewDecFromIntWithPrec(i Int, prec int64) Dec
- func NewDecFromStr(str string) (Dec, error)
- func NewDecWithBigIntAndPrec(i *big.Int, prec int64) Dec
- func NewDecWithPrec(i, prec int64) Dec
- func OneDec() Dec
- func SmallestDec() Dec
- func ZeroDec() Dec
- func (d Dec) Abs() Dec
- func (d Dec) Add(d2 Dec) Dec
- func (d Dec) AminoSize(_ *amino.Codec) int
- func (d Dec) ApproxRoot(root uint64) (guess Dec, err error)
- func (d Dec) ApproxSqrt() (Dec, error)
- func (d Dec) BigInt() *big.Int
- func (d Dec) Ceil() Dec
- func (d Dec) Equal(d2 Dec) bool
- func (d Dec) Format(s fmt.State, verb rune)
- func (d Dec) GT(d2 Dec) bool
- func (d Dec) GTE(d2 Dec) bool
- func (d Dec) IsInteger() bool
- func (d Dec) IsNegative() bool
- func (d Dec) IsNil() bool
- func (d Dec) IsPositive() bool
- func (d Dec) IsZero() bool
- func (d Dec) LT(d2 Dec) bool
- func (d Dec) LTE(d2 Dec) bool
- func (d Dec) Marshal() ([]byte, error)
- func (d Dec) MarshalAmino() (string, error)
- func (d Dec) MarshalJSON() ([]byte, error)
- func (d *Dec) MarshalTo(data []byte) (n int, err error)
- func (d Dec) MarshalToAmino(_ *amino.Codec) ([]byte, error)
- func (d Dec) MarshalYAML() (interface{}, error)
- func (d Dec) Mul(d2 Dec) Dec
- func (d Dec) MulInt(i Int) Dec
- func (d Dec) MulInt64(i int64) Dec
- func (d Dec) MulInt64To(i int64, d2 *Dec)
- func (d Dec) MulTruncate(d2 Dec) Dec
- func (d Dec) Neg() Dec
- func (d Dec) Power(power uint64) Dec
- func (d Dec) Quo(d2 Dec) Dec
- func (d Dec) QuoInt(i Int) Dec
- func (d Dec) QuoInt64(i int64) Dec
- func (d Dec) QuoRoundUp(d2 Dec) Dec
- func (d Dec) QuoTruncate(d2 Dec) Dec
- func (d Dec) RoundDecimal(precision int64) Dec
- func (d Dec) RoundInt() Int
- func (d Dec) RoundInt64() int64
- func (d *Dec) Size() int
- func (d Dec) String() string
- func (d Dec) Sub(d2 Dec) Dec
- func (d Dec) TruncateDec() Dec
- func (d Dec) TruncateInt() Int
- func (d Dec) TruncateInt64() int64
- func (d Dec) TruncateWithPrec(prec int64) Int
- func (d *Dec) Unmarshal(data []byte) error
- func (d *Dec) UnmarshalAmino(text string) (err error)
- func (d *Dec) UnmarshalFromAmino(_ *amino.Codec, data []byte) error
- func (d *Dec) UnmarshalJSON(bz []byte) error
- type DecCoin
- func ConvertDecCoin(coin DecCoin, denom string) (DecCoin, error)
- func IBCParseDecCoin(coinStr string) (coin DecCoin, err error)
- func NewCoin(denom string, amount interface{}) DecCoin
- func NewDecCoin(denom string, amount Int) DecCoin
- func NewDecCoinFromCoin(coin Coin) DecCoin
- func NewDecCoinFromDec(denom string, amount Dec) DecCoin
- func NewIBCCoin(denom string, amount interface{}) DecCoin
- func NewIBCDecCoin(denom string, amount Int) DecCoin
- func NewInt64DecCoin(denom string, amount int64) DecCoin
- func NormalizeDecCoin(coin DecCoin) DecCoin
- func ParseDecCoin(coinStr string) (coin DecCoin, err error)
- func (coin DecCoin) Add(coinB DecCoin) DecCoin
- func (coin DecCoin) AminoSize(cdc *amino.Codec) int
- func (coin DecCoin) IsEqual(other DecCoin) bool
- func (coin DecCoin) IsGTE(other DecCoin) bool
- func (coin DecCoin) IsLT(other DecCoin) bool
- func (coin DecCoin) IsNegative() bool
- func (coin DecCoin) IsPositive() bool
- func (coin DecCoin) IsValid() bool
- func (coin DecCoin) IsZero() bool
- func (coin DecCoin) MarshalAminoTo(cdc *amino.Codec, buf *bytes.Buffer) error
- func (coin DecCoin) MarshalToAmino(cdc *amino.Codec) ([]byte, error)
- func (coin DecCoin) String() string
- func (coin DecCoin) Sub(coinB DecCoin) DecCoin
- func (dec DecCoin) ToCoins() Coins
- func (coin DecCoin) TruncateDecimal() (Coin, DecCoin)
- func (coin DecCoin) TruncateWithPrec(prec int64) (Coin, DecCoin)
- func (coin *DecCoin) UnmarshalFromAmino(cdc *amino.Codec, data []byte) error
- type DecCoinAdapter
- func (*DecCoinAdapter) Descriptor() ([]byte, []int)
- func (this *DecCoinAdapter) Equal(that interface{}) bool
- func (m *DecCoinAdapter) GetDenom() string
- func (m *DecCoinAdapter) Marshal() (dAtA []byte, err error)
- func (m *DecCoinAdapter) MarshalTo(dAtA []byte) (int, error)
- func (m *DecCoinAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*DecCoinAdapter) ProtoMessage()
- func (m *DecCoinAdapter) Reset()
- func (m *DecCoinAdapter) Size() (n int)
- func (coin DecCoinAdapter) String() string
- func (m *DecCoinAdapter) Unmarshal(dAtA []byte) error
- func (m *DecCoinAdapter) XXX_DiscardUnknown()
- func (m *DecCoinAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DecCoinAdapter) XXX_Merge(src proto.Message)
- func (m *DecCoinAdapter) XXX_Size() int
- func (m *DecCoinAdapter) XXX_Unmarshal(b []byte) error
- type DecCoins
- func (coins DecCoins) Add(coinsB ...DecCoin) DecCoins
- func (coins DecCoins) Add2(coinsB DecCoins) DecCoins
- func (coins DecCoins) AmountOf(denom string) Dec
- func (coins DecCoins) Empty() bool
- func (coins DecCoins) GetDenomByIndex(i int) string
- func (coins DecCoins) Intersect(coinsB DecCoins) DecCoins
- func (coins DecCoins) IsAllPositive() bool
- func (coins DecCoins) IsAnyNegative() bool
- func (coins DecCoins) IsEqual(coinsB DecCoins) bool
- func (coins DecCoins) IsValid() bool
- func (coins DecCoins) IsZero() bool
- func (coins DecCoins) Len() int
- func (coins DecCoins) Less(i, j int) bool
- func (coins DecCoins) MulDec(d Dec) DecCoins
- func (coins DecCoins) MulDecTruncate(d Dec) DecCoins
- func (coins DecCoins) QuoDec(d Dec) DecCoins
- func (coins DecCoins) QuoDecTruncate(d Dec) DecCoins
- func (coins DecCoins) SafeSub(coinsB DecCoins) (DecCoins, bool)
- func (coins DecCoins) Sort() DecCoins
- func (coins DecCoins) String() string
- func (coins DecCoins) Sub(coinsB DecCoins) DecCoins
- func (coins DecCoins) Swap(i, j int)
- func (coins DecCoins) TruncateDecimal() (truncatedCoins Coins, changeCoins DecCoins)
- func (coins DecCoins) TruncateWithPrec(prec int64) (truncatedCoins Coins, changeCoins DecCoins)
- type DecProtoAdapter
- func (*DecProtoAdapter) Descriptor() ([]byte, []int)
- func (m *DecProtoAdapter) Marshal() (dAtA []byte, err error)
- func (m *DecProtoAdapter) MarshalTo(dAtA []byte) (int, error)
- func (m *DecProtoAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*DecProtoAdapter) ProtoMessage()
- func (m *DecProtoAdapter) Reset()
- func (m *DecProtoAdapter) Size() (n int)
- func (dp DecProtoAdapter) String() string
- func (m *DecProtoAdapter) Unmarshal(dAtA []byte) error
- func (m *DecProtoAdapter) XXX_DiscardUnknown()
- func (m *DecProtoAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DecProtoAdapter) XXX_Merge(src proto.Message)
- func (m *DecProtoAdapter) XXX_Size() int
- func (m *DecProtoAdapter) XXX_Unmarshal(b []byte) error
- type DynamicGasInfo
- type EmptyWatcher
- func (e EmptyWatcher) DeleteAccount(account interface{})
- func (e EmptyWatcher) DeleteContractBlockedList(addr interface{})
- func (e EmptyWatcher) DeleteContractDeploymentWhitelist(addr interface{})
- func (e EmptyWatcher) Destruct() []WatchMessage
- func (e EmptyWatcher) Enabled() bool
- func (e EmptyWatcher) Finalize()
- func (e EmptyWatcher) SaveAccount(account interface{})
- func (e EmptyWatcher) SaveContractBlockedListItem(addr interface{})
- func (e EmptyWatcher) SaveContractCode(addr common.Address, code []byte, height uint64)
- func (e EmptyWatcher) SaveContractCodeByHash(hash []byte, code []byte)
- func (e EmptyWatcher) SaveContractDeploymentWhitelistItem(addr interface{})
- func (e EmptyWatcher) SaveContractMethodBlockedListItem(addr interface{}, methods []byte)
- func (e EmptyWatcher) SaveState(addr common.Address, key, value []byte)
- type EndBlocker
- type EnvRegexp
- type EnvelopedErr
- func ErrGasOverflow(msg string) EnvelopedErr
- func ErrInsufficientCoins(msg string) EnvelopedErr
- func ErrInsufficientFee(msg string) EnvelopedErr
- func ErrInsufficientFunds(msg string) EnvelopedErr
- func ErrInternal(msg string) EnvelopedErr
- func ErrInvalidAddress(msg string) EnvelopedErr
- func ErrInvalidCoins(msg string) EnvelopedErr
- func ErrInvalidPubKey(msg string) EnvelopedErr
- func ErrInvalidSequence(msg string) EnvelopedErr
- func ErrMemoTooLarge(msg string) EnvelopedErr
- func ErrNoSignatures(msg string) EnvelopedErr
- func ErrOutOfGas(msg string) EnvelopedErr
- func ErrTooManySignatures(msg string) EnvelopedErr
- func ErrTxDecode(msg string) EnvelopedErr
- func ErrUnauthorized(msg string) EnvelopedErr
- func ErrUnknownAddress(msg string) EnvelopedErr
- func ErrUnknownRequest(msg string) EnvelopedErr
- type Error
- type ErrorGasOverflow
- type ErrorOutOfGas
- type Event
- type EventManager
- type Events
- type EvmSysContractAddressHandler
- type EvmWatcherCollector
- type FeeSplitInfo
- type Gas
- type GasConfig
- type GasInfo
- type GasMeter
- type GasRefundHandler
- type GetTxFeeAndFromHandler
- type GetTxFeeHandler
- type Handler
- type HeightSensitive
- type IWatcher
- type InitChainer
- type Int
- func MaxInt(i, i2 Int) Int
- func MinInt(i1, i2 Int) Int
- func NewInt(n int64) Int
- func NewIntFromBigInt(i *big.Int) Int
- func NewIntFromString(s string) (res Int, ok bool)
- func NewIntFromUint64(n uint64) Int
- func NewIntWithDecimal(n int64, dec int) Int
- func OneInt() Int
- func TokensFromConsensusPower(power int64) Int
- func ZeroInt() Int
- func (i Int) Add(i2 Int) (res Int)
- func (i Int) AddRaw(i2 int64) Int
- func (i Int) BigInt() *big.Int
- func (i Int) Equal(i2 Int) bool
- func (i Int) GT(i2 Int) bool
- func (i Int) GTE(i2 Int) bool
- func (i Int) Int64() int64
- func (i Int) IsInt64() bool
- func (i Int) IsNegative() bool
- func (i Int) IsNil() bool
- func (i Int) IsPositive() bool
- func (i Int) IsUint64() bool
- func (i Int) IsZero() bool
- func (i Int) LT(i2 Int) bool
- func (i Int) LTE(i2 Int) bool
- func (i Int) Marshal() ([]byte, error)
- func (i Int) MarshalAmino() (string, error)
- func (i Int) MarshalJSON() ([]byte, error)
- func (i *Int) MarshalTo(data []byte) (n int, err error)
- func (i Int) MarshalYAML() (interface{}, error)
- func (i Int) Mod(i2 Int) Int
- func (i Int) ModRaw(i2 int64) Int
- func (i Int) Mul(i2 Int) (res Int)
- func (i Int) MulRaw(i2 int64) Int
- func (i Int) Neg() (res Int)
- func (i Int) Quo(i2 Int) (res Int)
- func (i Int) QuoRaw(i2 int64) Int
- func (i Int) Sign() int
- func (i *Int) Size() int
- func (i Int) String() string
- func (i Int) Sub(i2 Int) (res Int)
- func (i Int) SubRaw(i2 int64) Int
- func (i Int) ToDec() Dec
- func (i Int) Uint64() uint64
- func (i *Int) Unmarshal(data []byte) error
- func (i *Int) UnmarshalAmino(text string) error
- func (i *Int) UnmarshalFromAmino(_ *amino.Codec, data []byte) error
- func (i *Int) UnmarshalJSON(bz []byte) error
- type IntProtoAdapter
- func (*IntProtoAdapter) Descriptor() ([]byte, []int)
- func (m *IntProtoAdapter) Marshal() (dAtA []byte, err error)
- func (m *IntProtoAdapter) MarshalTo(dAtA []byte) (int, error)
- func (m *IntProtoAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*IntProtoAdapter) ProtoMessage()
- func (m *IntProtoAdapter) Reset()
- func (m *IntProtoAdapter) Size() (n int)
- func (ip IntProtoAdapter) String() string
- func (m *IntProtoAdapter) Unmarshal(dAtA []byte) error
- func (m *IntProtoAdapter) XXX_DiscardUnknown()
- func (m *IntProtoAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *IntProtoAdapter) XXX_Merge(src proto.Message)
- func (m *IntProtoAdapter) XXX_Size() int
- func (m *IntProtoAdapter) XXX_Unmarshal(b []byte) error
- type Invariant
- type InvariantRegistry
- type Invariants
- type Iterator
- func KVStorePrefixIterator(kvs KVStore, prefix []byte) Iterator
- func KVStorePrefixIteratorPaginated(kvs KVStore, prefix []byte, page, limit uint) Iterator
- func KVStoreReversePrefixIterator(kvs KVStore, prefix []byte) Iterator
- func KVStoreReversePrefixIteratorPaginated(kvs KVStore, prefix []byte, page, limit uint) Iterator
- type KVPair
- type KVStore
- type KVStoreKey
- type LogFix
- type MemoryStoreKey
- type ModuleAccount
- type MptCommitHandler
- type Msg
- type MsgAdapter
- type MsgProtoAdapter
- type MsgRequest
- type MultiStore
- type MultiStorePersistentCache
- type ParaMsg
- type PeerFilter
- type PreDeliverTxHandler
- type PruningOptions
- type Querier
- type QueryRouter
- type QueryTraceTx
- type Queryable
- type Request
- type Result
- type ReusableGasMeter
- type Route
- type Router
- type SearchTxsResult
- type ServiceMsg
- func (msg ServiceMsg) GetSignBytes() []byte
- func (msg ServiceMsg) GetSigners() []AccAddress
- func (msg ServiceMsg) ProtoMessage()
- func (msg ServiceMsg) Reset()
- func (msg ServiceMsg) Route() string
- func (msg ServiceMsg) String() string
- func (msg ServiceMsg) Type() string
- func (msg ServiceMsg) ValidateBasic() error
- type SimulateData
- type SimulationResponse
- type Store
- type StoreDecoderRegistry
- type StoreKey
- type StoreType
- type StringEvent
- type StringEvents
- type SysCoin
- type SysCoins
- type Terminator
- type TestMsg
- type TestMsg2
- type TraceContext
- type TransactionType
- type TransientStoreKey
- type Tx
- type TxAdapter
- type TxDecoder
- type TxEncoder
- type TxResponse
- type TxWatcher
- type Uint
- func (u Uint) Add(u2 Uint) Uint
- func (u Uint) AddUint64(u2 uint64) Uint
- func (u Uint) BigInt() *big.Int
- func (u Uint) Decr() Uint
- func (u Uint) Equal(u2 Uint) bool
- func (u Uint) GT(u2 Uint) bool
- func (u Uint) GTE(u2 Uint) bool
- func (u Uint) Incr() Uint
- func (u Uint) IsZero() bool
- func (u Uint) LT(u2 Uint) bool
- func (u Uint) LTE(u2 Uint) bool
- func (u Uint) MarshalAmino() (string, error)
- func (u Uint) MarshalJSON() ([]byte, error)
- func (u Uint) Mod(u2 Uint) Uint
- func (u Uint) Mul(u2 Uint) (res Uint)
- func (u Uint) MulUint64(u2 uint64) (res Uint)
- func (u Uint) Quo(u2 Uint) (res Uint)
- func (u Uint) QuoUint64(u2 uint64) Uint
- func (u Uint) String() string
- func (u Uint) Sub(u2 Uint) Uint
- func (u Uint) SubUint64(u2 uint64) Uint
- func (u Uint) Uint64() uint64
- func (u *Uint) UnmarshalAmino(text string) error
- func (u *Uint) UnmarshalJSON(bz []byte) error
- type UpdateFeeCollectorAccHandler
- type UpdateFeeSplitHandler
- type UpdateGPOHandler
- type ValAddress
- func (va ValAddress) Bytes() []byte
- func (va ValAddress) Empty() bool
- func (va ValAddress) Equals(va2 Address) bool
- func (va ValAddress) Format(s fmt.State, verb rune)
- func (va ValAddress) Marshal() ([]byte, error)
- func (va ValAddress) MarshalJSON() ([]byte, error)
- func (va ValAddress) MarshalYAML() (interface{}, error)
- func (va ValAddress) String() string
- func (va *ValAddress) Unmarshal(data []byte) error
- func (va *ValAddress) UnmarshalJSON(data []byte) error
- func (va *ValAddress) UnmarshalYAML(data []byte) error
- type WatchMessage
Constants ¶
const ( // AddrLen defines a valid address length AddrLen = 20 // WasmContractAddrLen defines a valid wasm contract address length WasmContractAddrLen = 32 // Bech32MainPrefix defines the main SDK Bech32 prefix of an account's address Bech32MainPrefix = "cosmos" // CoinType is the ATOM coin type as defined in SLIP44 (https://github.com/satoshilabs/slips/blob/master/slip-0044.md) CoinType = 118 // FullFundraiserPath is the parts of the BIP44 HD path that are fixed by // what we used during the ATOM fundraiser. FullFundraiserPath = "m/44'/118'/0'/0/0" // PrefixAccount is the prefix for account keys PrefixAccount = "acc" // PrefixValidator is the prefix for validator keys PrefixValidator = "val" // PrefixConsensus is the prefix for consensus keys PrefixConsensus = "cons" // PrefixPublic is the prefix for public keys PrefixPublic = "pub" // PrefixOperator is the prefix for operator keys PrefixOperator = "oper" // PrefixAddress is the prefix for addresses PrefixAddress = "addr" // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address Bech32PrefixAccAddr = Bech32MainPrefix // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key Bech32PrefixAccPub = Bech32MainPrefix + PrefixPublic // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address Bech32PrefixValAddr = Bech32MainPrefix + PrefixValidator + PrefixOperator // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key Bech32PrefixValPub = Bech32MainPrefix + PrefixValidator + PrefixOperator + PrefixPublic // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address Bech32PrefixConsAddr = Bech32MainPrefix + PrefixValidator + PrefixConsensus // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key Bech32PrefixConsPub = Bech32MainPrefix + PrefixValidator + PrefixConsensus + PrefixPublic )
const ( // number of decimal places Precision = 18 // bytes required to represent the above precision // Ceiling[Log2[999 999 999 999 999 999]] DecimalPrecisionBits = 60 )
const ( CodeOK uint32 = 0 CodeInternal uint32 = 23 CodeGasOverflow uint32 = 22 )
const ( // default bond denomination DefaultBondDenom = "fibo" // Delay, in blocks, between when validator updates are returned to the // consensus-engine and when they are applied. For example, if // ValidatorUpdateDelay is set to X, and if a validator set update is // returned with new validators at the end of block 10, then the new // validators are expected to sign blocks beginning at block 11+X. // // This value is constant as this should not change without a hard fork. // For Tendermint this should be set to 1 block, for more details see: // https://tendermint.com/docs/spec/abci/apps.html#endblock ValidatorUpdateDelay int64 = 1 )
staking constants
const ( Unbonded BondStatus = 0x00 Unbonding BondStatus = 0x01 Bonded BondStatus = 0x02 BondStatusUnbonded = "Unbonded" BondStatusUnbonding = "Unbonding" BondStatusBonded = "Bonded" )
staking constants
const ( StoreTypeMulti = types.StoreTypeMulti StoreTypeDB = types.StoreTypeDB StoreTypeIAVL = types.StoreTypeIAVL StoreTypeTransient = types.StoreTypeTransient StoreTypeMPT = types.StoreTypeMPT StoreTypeMemory = types.StoreTypeMemory )
nolint - reexport
const AnteTerminatorTag = "ante-terminator"
const DefaultDecInt = 1000000000000000000
const DefaultDecStr = "1000000000000000000"
const DefaultIbcWei = "wei"
DefaultIbcWei for ibc transfer default okt min unit
const DefaultKeyringServiceName = "cosmos"
DefaultKeyringServiceName defines a default service name for the keyring.
const FlagDBBackend = "db_backend"
const (
IBCROUTER = "ibc"
)
const (
// MsgInterfaceProtoName defines the protobuf name of the cosmos Msg interface
MsgInterfaceProtoName = "cosmos.base.v1beta1.Msg"
)
const SortableTimeFormat = "2006-01-02T15:04:05.000000000"
Slight modification of the RFC3339Nano but it right pads all zeros and drops the time zone info
Variables ¶
var ( ParseCoin = ParseDecCoin ParseCoins = ParseDecCoins )
var ( FlagMultiCache = "multi-cache" MaxAccInMultiCache = "multi-cache-acc" MaxStorageInMultiCache = "multi-cache-storage" UseCache bool )
var ( ErrInvalidLengthCoinAdapter = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCoinAdapter = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupCoinAdapter = fmt.Errorf("proto: unexpected end of group") )
var ( ErrEmptyDecimalStr = errors.New("decimal string cannot be empty") ErrInvalidDecimalLength = errors.New("invalid decimal length") ErrInvalidDecimalStr = errors.New("invalid decimal string") )
Decimal errors
var ( CodeTxDecode uint32 = errors.ErrTxDecode.ABCICode() CodeInvalidSequence uint32 = errors.ErrInvalidSequence.ABCICode() CodeInsufficientFunds uint32 = errors.ErrInsufficientFunds.ABCICode() CodeUnknownRequest uint32 = errors.ErrUnknownRequest.ABCICode() CodeInvalidAddress uint32 = errors.ErrInvalidAddress.ABCICode() CodeInvalidPubKey uint32 = errors.ErrInvalidPubKey.ABCICode() CodeUnknownAddress uint32 = errors.ErrUnknownAddress.ABCICode() CodeInsufficientCoins uint32 = errors.ErrInsufficientFunds.ABCICode() CodeInvalidCoins uint32 = errors.ErrInvalidCoins.ABCICode() CodeOutOfGas uint32 = errors.ErrOutOfGas.ABCICode() CodeMemoTooLarge uint32 = errors.ErrMemoTooLarge.ABCICode() CodeInsufficientFee uint32 = errors.ErrInsufficientFee.ABCICode() CodeTooManySignatures uint32 = errors.ErrTooManySignatures.ABCICode() CodeNoSignatures uint32 = errors.ErrNoSignatures.ABCICode() )
var ( EventTypeMessage = "message" AttributeKeyAction = "action" AttributeKeyModule = "module" AttributeKeySender = "sender" AttributeKeyAmount = "amount" AttributeKeyFee = "fee" )
Common event types and attribute keys
var ( // IsAlphaNumeric defines a regular expression for matching against alpha-numeric // values. IsAlphaNumeric = regexp.MustCompile(`^[a-zA-Z0-9]+$`).MatchString // IsAlphaLower defines regular expression to check if the string has lowercase // alphabetic characters only. IsAlphaLower = regexp.MustCompile(`^[a-z]+$`).MatchString // IsAlphaUpper defines regular expression to check if the string has uppercase // alphabetic characters only. IsAlphaUpper = regexp.MustCompile(`^[A-Z]+$`).MatchString // IsAlpha defines regular expression to check if the string has alphabetic // characters only. IsAlpha = regexp.MustCompile(`^[a-zA-Z]+$`).MatchString // IsNumeric defines regular expression to check if the string has numeric // characters only. IsNumeric = regexp.MustCompile(`^[0-9]+$`).MatchString )
var MaxSortableDec = OneDec().Quo(SmallestDec())
MaxSortableDec is the largest Dec that can be passed into SortableDecBytes() Its negative form is the least Dec that can be passed in.
var PowerReduction = NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(Precision), nil))
PowerReduction is the amount of staking tokens required for 1 unit of consensus-engine power
Functions ¶
func AppendMsgToErr ¶
appends a message to the head of the given error
func Bech32ifyPubKey ¶
func Bech32ifyPubKey(pkt Bech32PubKeyType, pubkey crypto.PubKey) (string, error)
Bech32ifyPubKey returns a Bech32 encoded string containing the appropriate prefix based on the key type provided for a given PublicKey.
func BigEndianToUint64 ¶
BigEndianToUint64 returns an uint64 from big endian encoded bytes. If encoding is empty, zero is returned.
func DefaultCoinDenomRegex ¶
func DefaultCoinDenomRegex() string
DefaultCoinDenomRegex returns the default regex string
func DefaultIBCCoinDenomRegex ¶
func DefaultIBCCoinDenomRegex() string
DefaultCoinDenomRegex returns the default regex string
func DiffKVStores ¶
DiffKVStores compares two KVstores and returns all the key/value pairs that differ from one another. It also skips value comparison for a set of provided prefixes
func FormatInvariant ¶
FormatInvariant returns a standardized invariant message.
func FormatTimeBytes ¶
Formats a time.Time into a []byte that can be sorted
func GetBaseDenom ¶
GetBaseDenom returns the denom of smallest unit registered
func GetFromBech32 ¶
GetFromBech32 decodes a bytestring from a Bech32 encoded string.
func GetPubKeyFromBech32 ¶
func GetPubKeyFromBech32(pkt Bech32PubKeyType, pubkeyStr string) (crypto.PubKey, error)
GetPubKeyFromBech32 returns a PublicKey from a bech32-encoded PublicKey with a given key type.
func InclusiveEndBytes ¶
InclusiveEndBytes returns the []byte that would end a range query such that the input would be included
func IsETHAddress ¶
func IsOKCAddress ¶
func IsWasmAddress ¶
func IsWasmAddress(acc AccAddress) bool
func KeyringServiceName ¶
func KeyringServiceName() string
func MsgTypeURL ¶
MsgTypeURL returns the TypeURL of a `sdk.Msg`.
func MustBech32ifyAccPub ¶
MustBech32ifyAccPub returns the result of Bech32ifyAccPub panicing on failure.
func MustBech32ifyPubKey ¶
func MustBech32ifyPubKey(pkt Bech32PubKeyType, pubkey crypto.PubKey) string
MustBech32ifyPubKey calls Bech32ifyPubKey except it panics on error.
func MustGetPubKeyFromBech32 ¶
func MustGetPubKeyFromBech32(pkt Bech32PubKeyType, pubkeyStr string) crypto.PubKey
MustGetPubKeyFromBech32 calls GetPubKeyFromBech32 except it panics on error.
func MustSortJSON ¶
MustSortJSON is like SortJSON but panic if an error occurs, e.g., if the passed JSON isn't valid.
func NewKVStoreKeys ¶
func NewKVStoreKeys(names ...string) map[string]*KVStoreKey
NewKVStoreKeys returns a map of new pointers to KVStoreKey's. Uses pointers so keys don't collide.
func NewMemoryStoreKeys ¶
func NewMemoryStoreKeys(names ...string) map[string]*MemoryStoreKey
NewMemoryStoreKeys constructs a new map matching store key names to their respective MemoryStoreKey references.
func NewTransientStoreKeys ¶
func NewTransientStoreKeys(names ...string) map[string]*TransientStoreKey
NewTransientStoreKeys constructs a new map of TransientStoreKey's Must return pointers according to the ocap principle
func ParseTimeBytes ¶
Parses a []byte encoded using FormatTimeKey back into a time.Time
func PrefixEndBytes ¶
PrefixEndBytes returns the []byte that would end a range query for all []byte with a certain prefix Deals with last byte of prefix being FF without overflowing
func RegisterDenom ¶
RegisterDenom registers a denomination with a corresponding unit. If the denomination is already registered, an error will be returned.
func ReturnInfiniteGasMeter ¶
func ReturnInfiniteGasMeter(gm ReusableGasMeter)
func SetCoinDenomRegex ¶
func SetCoinDenomRegex(reFn func() string)
SetCoinDenomRegex allows for coin's custom validation by overriding the regular expression string used for denom validation.
func SetIBCCoinDenomRegex ¶
func SetIBCCoinDenomRegex(reFn func() string)
func SortJSON ¶
SortedJSON takes any JSON and returns it sorted by keys. Also, all white-spaces are removed. This method can be used to canonicalize JSON to be returned by GetSignBytes, e.g. for the ledger integration. If the passed JSON isn't valid it will return an error.
func SortableDecBytes ¶
SortableDecBytes returns a byte slice representation of a Dec that can be sorted. Left and right pads with 0s so there are 18 digits to left and right of the decimal point. For this reason, there is a maximum and minimum value for this, enforced by ValidSortableDec.
func TokensToConsensusPower ¶
TokensToConsensusPower - convert input tokens to potential consensus-engine power
func Uint64ToBigEndian ¶
Uint64ToBigEndian - marshals uint64 to a bigendian byte slice so it can be sorted
func UintOverflow ¶
UintOverflow returns true if a given unsigned integer overflows and false otherwise.
func UnsafeBytesToStr ¶
UnsafeBytesToStr is meant to make a zero allocation conversion from []byte -> string to speed up operations, it is not meant to be used generally, but for a specific pattern to delete keys from a map.
func UnsafeStrToBytes ¶
UnsafeStrToBytes uses unsafe to convert string into byte array. Returned bytes must not be altered after this function is called as it will cause a segmentation fault.
func ValidCoins ¶
func ValidSortableDec ¶
ValidSortableDec ensures that a Dec is within the sortable bounds, a Dec can't have a precision of less than 10^-18. Max sortable decimal was set to the reciprocal of SmallestDec.
func ValidateDenom ¶
ValidateDenom validates a denomination string returning an error if it is invalid.
func VerifyAddressFormat ¶
VerifyAddressFormat verifies that the provided bytes form a valid address according to the default address rules or a custom address verifier set by GetConfig().SetAddressVerifier()
func WrapSDKContext ¶
WrapSDKContext returns a stdlib context.Context with the provided sdk.Context's internal context as a value. It is useful for passing an sdk.Context through methods that take a stdlib context.Context parameter such as generated gRPC methods. To get the original sdk.Context back, call UnwrapSDKContext.
Types ¶
type ABCIMessageLog ¶
type ABCIMessageLog struct { MsgIndex uint16 `json:"msg_index"` Log string `json:"log"` // Events contains a slice of Event objects that were emitted during some // execution. Events StringEvents `json:"events"` }
ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
func NewABCIMessageLog ¶
func NewABCIMessageLog(i uint16, log string, events Events) ABCIMessageLog
func (ABCIMessageLog) MarshalJsonToBuffer ¶
func (log ABCIMessageLog) MarshalJsonToBuffer(buf *bytes.Buffer) error
type ABCIMessageLogs ¶
type ABCIMessageLogs []ABCIMessageLog
ABCIMessageLogs represents a slice of ABCIMessageLog.
func ParseABCILogs ¶
func ParseABCILogs(logs string) (res ABCIMessageLogs, err error)
ParseABCILogs attempts to parse a stringified ABCI tx log into a slice of ABCIMessageLog types. It returns an error upon JSON decoding failure.
func (ABCIMessageLogs) MarshalJsonToBuffer ¶
func (logs ABCIMessageLogs) MarshalJsonToBuffer(buf *bytes.Buffer) error
func (ABCIMessageLogs) MarshalToJson ¶
func (logs ABCIMessageLogs) MarshalToJson() ([]byte, error)
func (ABCIMessageLogs) String ¶
func (logs ABCIMessageLogs) String() (str string)
String implements the fmt.Stringer interface for the ABCIMessageLogs type.
type AccAddress ¶
type AccAddress []byte
AccAddress a wrapper around bytes meant to represent an account address. When marshaled to a string or JSON, it uses Bech32.
func AccAddressFromBech32 ¶
func AccAddressFromBech32(address string) (AccAddress, error)
AccAddressFromBech32 creates an AccAddress from a Bech32 string.
func AccAddressFromBech32ByPrefix ¶
func AccAddressFromBech32ByPrefix(address string, bech32PrefixAccAddr string) (addr AccAddress, err error)
AccAddressFromBech32ByPrefix create an AccAddress from a Bech32 string by address prefix
func AccAddressFromHex ¶
func AccAddressFromHex(address string) (addr AccAddress, err error)
AccAddressFromHex creates an AccAddress from a hex string.
func MustAccAddressFromBech32 ¶
func MustAccAddressFromBech32(address string) AccAddress
MustAccAddressFromBech32 calls AccAddressFromBech32 and panics on error.
func (AccAddress) Bech32String ¶
func (aa AccAddress) Bech32String(bech32PrefixAccAddr string) string
Bech32String convert account address to bech32 address.
func (AccAddress) Bech32StringOptimized ¶
func (aa AccAddress) Bech32StringOptimized(bech32PrefixAccAddr string) string
func (AccAddress) Empty ¶
func (aa AccAddress) Empty() bool
Returns boolean for whether an AccAddress is empty
func (AccAddress) Equals ¶
func (aa AccAddress) Equals(aa2 Address) bool
Returns boolean for whether two AccAddresses are Equal
func (AccAddress) Format ¶
func (aa AccAddress) Format(s fmt.State, verb rune)
Format implements the fmt.Formatter interface. nolint: errcheck
func (AccAddress) Marshal ¶
func (aa AccAddress) Marshal() ([]byte, error)
Marshal returns the raw address bytes. It is needed for protobuf compatibility.
func (AccAddress) MarshalJSON ¶
func (aa AccAddress) MarshalJSON() ([]byte, error)
MarshalJSON marshals to JSON using Bech32.
func (AccAddress) MarshalYAML ¶
func (aa AccAddress) MarshalYAML() (interface{}, error)
MarshalYAML marshals to YAML using Bech32.
func (AccAddress) String ¶
func (aa AccAddress) String() string
String implements the Stringer interface.
func (*AccAddress) Unmarshal ¶
func (aa *AccAddress) Unmarshal(data []byte) error
Unmarshal sets the address to the given data. It is needed for protobuf compatibility.
func (*AccAddress) UnmarshalJSON ¶
func (aa *AccAddress) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals from JSON assuming Bech32 encoding.
func (*AccAddress) UnmarshalYAML ¶
func (aa *AccAddress) UnmarshalYAML(data []byte) error
UnmarshalYAML unmarshals from JSON assuming Bech32 encoding.
type AccNonceHandler ¶
type AccNonceHandler func(ctx Context, address AccAddress) (nonce uint64)
type Account ¶
type Account interface { Copy() Account GetAddress() AccAddress SetAddress(AccAddress) error GetPubKey() crypto.PubKey SetPubKey(crypto.PubKey) error GetAccountNumber() uint64 SetAccountNumber(uint64) error GetSequence() uint64 SetSequence(uint64) error GetCoins() Coins SetCoins(Coins) error SpendableCoins(blockTime time.Time) Coins String() string }
type AccountCache ¶
type Address ¶
type Address interface { Equals(Address) bool Empty() bool Marshal() ([]byte, error) MarshalJSON() ([]byte, error) Bytes() []byte String() string Format(s fmt.State, verb rune) }
Address is a common interface for different types of addresses used by the SDK
type AnteDecorator ¶
type AnteDecorator interface {
AnteHandle(ctx Context, tx Tx, simulate bool, next AnteHandler) (newCtx Context, err error)
}
AnteDecorator wraps the next AnteHandler to perform custom pre- and post-processing.
type AnteHandler ¶
AnteHandler authenticates transactions, before their internal messages are handled. If newCtx.IsZero(), ctx is used instead.
func ChainAnteDecorators ¶
func ChainAnteDecorators(chain ...AnteDecorator) AnteHandler
ChainDecorator chains AnteDecorators together with each AnteDecorator wrapping over the decorators further along chain and returns a single AnteHandler.
NOTE: The first element is outermost decorator, while the last element is innermost decorator. Decorator ordering is critical since some decorators will expect certain checks and updates to be performed (e.g. the Context) before the decorator is run. These expectations should be documented clearly in a CONTRACT docline in the decorator's godoc.
NOTE: Any application that uses GasMeter to limit transaction processing cost MUST set GasMeter with the FIRST AnteDecorator. Failing to do so will cause transactions to be processed with an infinite gasmeter and open a DOS attack vector. Use `ante.SetUpContextDecorator` or a custom Decorator with similar functionality. Returns nil when no AnteDecorator are supplied.
type Attribute ¶
Attribute defines an attribute wrapper where the key and value are strings instead of raw bytes.
func NewAttribute ¶
NewAttribute returns a new key/value Attribute object.
func (Attribute) MarshalJsonToBuffer ¶
type BaseTx ¶
func (*BaseTx) GetGasPrice ¶
func (*BaseTx) GetSigners ¶
func (tx *BaseTx) GetSigners() []AccAddress
func (*BaseTx) GetTxFnSignatureInfo ¶
func (*BaseTx) GetType ¶
func (tx *BaseTx) GetType() TransactionType
func (*BaseTx) ValidateBasic ¶
type Bech32PubKeyType ¶
type Bech32PubKeyType string
Bech32PubKeyType defines a string type alias for a Bech32 public key type.
const ( Bech32PubKeyTypeAccPub Bech32PubKeyType = "accpub" Bech32PubKeyTypeValPub Bech32PubKeyType = "valpub" Bech32PubKeyTypeConsPub Bech32PubKeyType = "conspub" )
Bech32 conversion constants
type BeginBlocker ¶
type BeginBlocker func(ctx Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlocker runs code before the transactions in a block
Note: applications which set create_empty_blocks=false will not have regular block timing and should use e.g. BFT timestamps rather than block height for any periodic BeginBlock logic
type BondStatus ¶
type BondStatus byte
BondStatus is the status of a validator
func (BondStatus) Equal ¶
func (b BondStatus) Equal(b2 BondStatus) bool
Equal compares two BondStatus instances
func (BondStatus) String ¶
func (b BondStatus) String() string
String implements the Stringer interface for BondStatus.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func NewChainCache ¶
func NewChainCache() *Cache
func (*Cache) DisableCache ¶
func (c *Cache) DisableCache()
func (*Cache) GetStorage ¶
func (*Cache) UpdateAccount ¶
func (c *Cache) UpdateAccount(addr AccAddress, acc Account, lenBytes int, isDirty bool)
func (*Cache) UpdateStorage ¶
type Codespacer ¶
type Codespacer interface {
Codespace() string
}
type Coin ¶
type Coin = DecCoin
func CoinAdapterToCoin ¶
func CoinAdapterToCoin(adapter CoinAdapter) Coin
func ConvertCoin ¶
ConvertCoin attempts to convert a coin to a given denomination. If the given denomination is invalid or if neither denomination is registered, an error is returned.
func GetSystemFee ¶
func GetSystemFee() Coin
func NewInt64Coin ¶
NewInt64Coin returns a new coin with a denomination and amount. It will panic if the amount is negative.
func NormalizeCoin ¶
NormalizeCoin try to convert a coin to the smallest unit registered, returns original one if failed.
func ParseCoinNormalized ¶
ParseCoinNormalized parses and normalize a cli input for one coin type, returning errors if invalid or on an empty string as well. Expected format: "{amount}{denomination}"
type CoinAdapter ¶
type CoinAdapter struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` Amount Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=Int" json:"amount"` }
CoinAdapter defines a token with a denomination and an amount.
NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto.
func CoinToCoinAdapter ¶
func CoinToCoinAdapter(adapter Coin) CoinAdapter
func NewCoinAdapter ¶
func NewCoinAdapter(denom string, amount Int) CoinAdapter
NewCoin returns a new coin with a denomination and amount. It will panic if the amount is negative or if the denomination is invalid.
func (CoinAdapter) Add ¶
func (coin CoinAdapter) Add(coinB CoinAdapter) CoinAdapter
Add adds amounts of two coins with same denom. If the coins differ in denom then it panics.
func (CoinAdapter) AddAmount ¶
func (coin CoinAdapter) AddAmount(amount Int) CoinAdapter
AddAmount adds an amount to the Coin.
func (*CoinAdapter) Descriptor ¶
func (*CoinAdapter) Descriptor() ([]byte, []int)
func (*CoinAdapter) Equal ¶
func (this *CoinAdapter) Equal(that interface{}) bool
func (*CoinAdapter) GetDenom ¶
func (m *CoinAdapter) GetDenom() string
func (CoinAdapter) IsEqual ¶
func (coin CoinAdapter) IsEqual(other CoinAdapter) bool
IsEqual returns true if the two sets of Coins have the same value
func (CoinAdapter) IsGTE ¶
func (coin CoinAdapter) IsGTE(other CoinAdapter) bool
IsGTE returns true if they are the same type and the receiver is an equal or greater value
func (CoinAdapter) IsLT ¶
func (coin CoinAdapter) IsLT(other CoinAdapter) bool
IsLT returns true if they are the same type and the receiver is a smaller value
func (CoinAdapter) IsNegative ¶
func (coin CoinAdapter) IsNegative() bool
IsNegative returns true if the coin amount is negative and false otherwise.
TODO: Remove once unsigned integers are used.
func (CoinAdapter) IsPositive ¶
func (coin CoinAdapter) IsPositive() bool
IsPositive returns true if coin amount is positive.
TODO: Remove once unsigned integers are used.
func (CoinAdapter) IsValid ¶
func (coin CoinAdapter) IsValid() bool
IsValid returns true if the Coin has a non-negative amount and the denom is valid.
func (CoinAdapter) IsZero ¶
func (coin CoinAdapter) IsZero() bool
IsZero returns if this represents no money
func (*CoinAdapter) Marshal ¶
func (m *CoinAdapter) Marshal() (dAtA []byte, err error)
func (*CoinAdapter) MarshalToSizedBuffer ¶
func (m *CoinAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CoinAdapter) ProtoMessage ¶
func (*CoinAdapter) ProtoMessage()
func (*CoinAdapter) Reset ¶
func (m *CoinAdapter) Reset()
func (*CoinAdapter) Size ¶
func (m *CoinAdapter) Size() (n int)
func (CoinAdapter) String ¶
func (coin CoinAdapter) String() string
String provides a human-readable representation of a coin
func (CoinAdapter) Sub ¶
func (coin CoinAdapter) Sub(coinB CoinAdapter) CoinAdapter
Sub subtracts amounts of two coins with same denom. If the coins differ in denom then it panics.
func (CoinAdapter) ToCoin ¶
func (cs CoinAdapter) ToCoin() Coin
func (*CoinAdapter) Unmarshal ¶
func (m *CoinAdapter) Unmarshal(dAtA []byte) error
func (CoinAdapter) Validate ¶
func (coin CoinAdapter) Validate() error
Validate returns an error if the Coin has a negative amount or if the denom is invalid.
func (*CoinAdapter) XXX_DiscardUnknown ¶
func (m *CoinAdapter) XXX_DiscardUnknown()
func (*CoinAdapter) XXX_Marshal ¶
func (m *CoinAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CoinAdapter) XXX_Merge ¶
func (m *CoinAdapter) XXX_Merge(src proto.Message)
func (*CoinAdapter) XXX_Size ¶
func (m *CoinAdapter) XXX_Size() int
func (*CoinAdapter) XXX_Unmarshal ¶
func (m *CoinAdapter) XXX_Unmarshal(b []byte) error
type CoinAdapters ¶
type CoinAdapters []CoinAdapter
func CoinsToCoinAdapters ¶
func CoinsToCoinAdapters(coins Coins) CoinAdapters
func ConvWei2TOkt ¶
func ConvWei2TOkt(adapters CoinAdapters) (CoinAdapters, error)
func (CoinAdapters) Add ¶
func (coins CoinAdapters) Add(coinsB ...CoinAdapter) CoinAdapters
func (CoinAdapters) AmountOf ¶
func (coins CoinAdapters) AmountOf(denom string) Int
AmountOf returns the amount of a denom from coins
func (CoinAdapters) AmountOfNoDenomValidation ¶
func (coins CoinAdapters) AmountOfNoDenomValidation(denom string) Int
AmountOfNoDenomValidation returns the amount of a denom from coins without validating the denomination.
func (CoinAdapters) Copy ¶
func (coins CoinAdapters) Copy() CoinAdapters
func (CoinAdapters) IsAllPositive ¶
func (coins CoinAdapters) IsAllPositive() bool
IsAllPositive returns true if there is at least one coin and all currencies have a positive value.
func (CoinAdapters) IsAnyNegative ¶
func (cas CoinAdapters) IsAnyNegative() bool
func (CoinAdapters) IsAnyNil ¶
func (cas CoinAdapters) IsAnyNil() bool
func (CoinAdapters) IsValid ¶
func (coins CoinAdapters) IsValid() bool
IsValid calls Validate and returns true when the Coins are sorted, have positive amount, with a valid and unique denomination (i.e no duplicates).
func (CoinAdapters) IsZero ¶
func (coins CoinAdapters) IsZero() bool
func (CoinAdapters) MarshalJSON ¶
func (coins CoinAdapters) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the Coins type to allow nil Coins to be encoded as an empty array.
func (CoinAdapters) SafeSub ¶
func (coins CoinAdapters) SafeSub(coinsB CoinAdapters) (CoinAdapters, bool)
func (CoinAdapters) String ¶
func (coins CoinAdapters) String() string
func (CoinAdapters) Sub ¶
func (coins CoinAdapters) Sub(coinsB CoinAdapters) CoinAdapters
func (CoinAdapters) ToCoins ¶
func (cs CoinAdapters) ToCoins() Coins
func (CoinAdapters) Validate ¶
func (coins CoinAdapters) Validate() error
type Coins ¶
type Coins = DecCoins
func CoinAdaptersToCoins ¶
func CoinAdaptersToCoins(adapters CoinAdapters) Coins
func MustParseCoins ¶
func NormalizeCoins ¶
NormalizeCoins normalize and truncate a list of decimal coins
func ParseCoinsNormalized ¶
ParseCoinsNormalized will parse out a list of coins separated by commas, and normalize them by converting to smallest unit. If the parsing is successuful, the provided coins will be sanitized by removing zero coins and sorting the coin set. Lastly a validation of the coin set is executed. If the check passes, ParseCoinsNormalized will return the sanitized coins. Otherwise it will return an error. If an empty string is provided to ParseCoinsNormalized, it returns nil Coins. ParseCoinsNormalized supports decimal coins as inputs, and truncate them to int after converted to smallest unit. Expected format: "{amount0}{denomination},...,{amountN}{denominationN}"
func (Coins) DenomsSubsetOf ¶
DenomsSubsetOf returns true if receiver's denom set is subset of coinsB's denoms.
func (Coins) IsAllGT ¶
IsAllGT returns true if for every denom in coinsB, the denom is present at a greater amount in coins.
func (Coins) IsAllGTE ¶
IsAllGTE returns false if for any denom in coinsB, the denom is present at a smaller amount in coins; else returns true.
func (Coins) IsAllLT ¶
IsAllLT returns True iff for every denom in coins, the denom is present at a smaller amount in coinsB.
func (Coins) IsAllLTE ¶
IsAllLTE returns true iff for every denom in coins, the denom is present at a smaller or equal amount in coinsB.
func (Coins) IsAnyGT ¶
IsAnyGT returns true iff for any denom in coins, the denom is present at a greater amount in coinsB.
e.g. {2A, 3B}.IsAnyGT{A} = true {2A, 3B}.IsAnyGT{5C} = false {}.IsAnyGT{5C} = false {2A, 3B}.IsAnyGT{} = false
func (Coins) IsAnyGTE ¶
IsAnyGTE returns true iff coins contains at least one denom that is present at a greater or equal amount in coinsB; it returns false otherwise.
NOTE: IsAnyGTE operates under the invariant that both coin sets are sorted by denominations and there exists no zero coins.
func (Coins) MarshalJSON ¶
MarshalJSON implements a custom JSON marshaller for the Coins type to allow nil Coins to be encoded as an empty array.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is the structure that holds the SDK configuration parameters. This could be used to initialize certain configuration parameters for the SDK.
func GetSealedConfig ¶
GetSealedConfig returns the config instance for the SDK if/once it is sealed.
func (*Config) GetAddressVerifier ¶
GetAddressVerifier returns the function to verify that addresses have the correct format
func (*Config) GetBech32AccountAddrPrefix ¶
GetBech32AccountAddrPrefix returns the Bech32 prefix for account address
func (*Config) GetBech32AccountPubPrefix ¶
GetBech32AccountPubPrefix returns the Bech32 prefix for account public key
func (*Config) GetBech32ConsensusAddrPrefix ¶
GetBech32ConsensusAddrPrefix returns the Bech32 prefix for consensus node address
func (*Config) GetBech32ConsensusPubPrefix ¶
GetBech32ConsensusPubPrefix returns the Bech32 prefix for consensus node public key
func (*Config) GetBech32ValidatorAddrPrefix ¶
GetBech32ValidatorAddrPrefix returns the Bech32 prefix for validator address
func (*Config) GetBech32ValidatorPubPrefix ¶
GetBech32ValidatorPubPrefix returns the Bech32 prefix for validator public key
func (*Config) GetCoinType ¶
GetCoinType returns the BIP-0044 CoinType code on the config.
func (*Config) GetFullFundraiserPath ¶
GetFullFundraiserPath returns the BIP44Prefix.
func (*Config) GetTxEncoder ¶
GetTxEncoder return function to encode transactions
func (*Config) Seal ¶
Seal seals the config such that the config state could not be modified further
func (*Config) SetAddressVerifier ¶
SetAddressVerifier builds the Config with the provided function for verifying that addresses have the correct format
func (*Config) SetBech32PrefixForAccount ¶
SetBech32PrefixForAccount builds the Config with Bech32 addressPrefix and publKeyPrefix for accounts and returns the config instance
func (*Config) SetBech32PrefixForConsensusNode ¶
SetBech32PrefixForConsensusNode builds the Config with Bech32 addressPrefix and publKeyPrefix for consensus nodes and returns the config instance
func (*Config) SetBech32PrefixForValidator ¶
SetBech32PrefixForValidator builds the Config with Bech32 addressPrefix and publKeyPrefix for validators
and returns the config instance
func (*Config) SetCoinType ¶
Set the BIP-0044 CoinType code on the config
func (*Config) SetFullFundraiserPath ¶
Set the FullFundraiserPath (BIP44Prefix) on the config
func (*Config) SetTxEncoder ¶
SetTxEncoder builds the Config with TxEncoder used to marshal StdTx to bytes
type ConsAddress ¶
type ConsAddress []byte
ConsAddress defines a wrapper around bytes meant to present a consensus node. When marshaled to a string or JSON, it uses Bech32.
func ConsAddressFromBech32 ¶
func ConsAddressFromBech32(address string) (addr ConsAddress, err error)
ConsAddressFromBech32 creates a ConsAddress from a Bech32 string.
func ConsAddressFromHex ¶
func ConsAddressFromHex(address string) (addr ConsAddress, err error)
ConsAddressFromHex creates a ConsAddress from a hex string.
func GetConsAddress ¶
func GetConsAddress(pubkey crypto.PubKey) ConsAddress
get ConsAddress from pubkey
func (ConsAddress) Bytes ¶
func (ca ConsAddress) Bytes() []byte
Bytes returns the raw address bytes.
func (ConsAddress) Empty ¶
func (ca ConsAddress) Empty() bool
Returns boolean for whether an ConsAddress is empty
func (ConsAddress) Equals ¶
func (ca ConsAddress) Equals(ca2 Address) bool
Returns boolean for whether two ConsAddress are Equal
func (ConsAddress) Format ¶
func (ca ConsAddress) Format(s fmt.State, verb rune)
Format implements the fmt.Formatter interface. nolint: errcheck
func (ConsAddress) Marshal ¶
func (ca ConsAddress) Marshal() ([]byte, error)
Marshal returns the raw address bytes. It is needed for protobuf compatibility.
func (ConsAddress) MarshalJSON ¶
func (ca ConsAddress) MarshalJSON() ([]byte, error)
MarshalJSON marshals to JSON using Bech32.
func (ConsAddress) MarshalYAML ¶
func (ca ConsAddress) MarshalYAML() (interface{}, error)
MarshalYAML marshals to YAML using Bech32.
func (ConsAddress) String ¶
func (ca ConsAddress) String() string
String implements the Stringer interface.
func (*ConsAddress) Unmarshal ¶
func (ca *ConsAddress) Unmarshal(data []byte) error
Unmarshal sets the address to the given data. It is needed for protobuf compatibility.
func (*ConsAddress) UnmarshalJSON ¶
func (ca *ConsAddress) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals from JSON assuming Bech32 encoding.
func (*ConsAddress) UnmarshalYAML ¶
func (ca *ConsAddress) UnmarshalYAML(data []byte) error
UnmarshalYAML unmarshals from YAML assuming Bech32 encoding.
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is an immutable object contains all information needed to process a request.
It contains a context.Context object inside if you want to use that, but please do not over-use it. We try to keep all data structured and standard additions here would be better just to add to the Context struct
func NewContext ¶
NewContext create a new context
func UnwrapSDKContext ¶
UnwrapSDKContext retrieves a Context from a context.Context instance attached with WrapSDKContext. It panics if a Context was not properly attached
func (*Context) AccountNonce ¶
func (*Context) AnteTracer ¶
func (*Context) BlockGasMeter ¶
func (*Context) BlockHeader ¶
BlockHeader clone the header before returning
func (*Context) BlockHeight ¶
func (*Context) BlockProposerAddress ¶
func (*Context) CacheContext ¶
CacheContext returns a new Context with the multi-store cached and a new EventManager. The cached context is written to the context when writeCache is called.
func (*Context) ConsensusParams ¶
func (c *Context) ConsensusParams() *abci.ConsensusParams
func (*Context) DisableAccountCache ¶
func (c *Context) DisableAccountCache()
func (*Context) EnableAccountCache ¶
func (c *Context) EnableAccountCache()
func (*Context) EventManager ¶
func (c *Context) EventManager() *EventManager
func (Context) GetFeeSplitInfo ¶
func (c Context) GetFeeSplitInfo() *FeeSplitInfo
func (*Context) GetFromAccountCacheData ¶
func (c *Context) GetFromAccountCacheData() interface{}
func (*Context) GetFromAccountCacheGas ¶
func (*Context) GetReusableKVStore ¶
GetReusableKVStore fetches a KVStore from the MultiStore than can be reused. you must call ReturnKVStore() after you are done with the KVStore.
func (*Context) GetToAccountCacheData ¶
func (c *Context) GetToAccountCacheData() interface{}
func (*Context) GetToAccountCacheGas ¶
func (*Context) GetWatcher ¶
func (*Context) IsReCheckTx ¶
func (*Context) IsTraceTxLog ¶
func (*Context) IsWrappedCheckTx ¶
func (*Context) MinGasPrices ¶
func (*Context) MultiStore ¶
func (c *Context) MultiStore() MultiStore
func (*Context) OverrideBytes ¶
func (*Context) ResetWatcher ¶
func (c *Context) ResetWatcher()
func (*Context) ReturnKVStore ¶
ReturnKVStore returns a KVStore than from GetReusableKVStore.
func (*Context) SetAccountNonce ¶
func (*Context) SetBlockGasMeter ¶
func (*Context) SetBlockHeight ¶
func (*Context) SetChainID ¶
func (*Context) SetConsensusParams ¶
func (c *Context) SetConsensusParams(params *abci.ConsensusParams) *Context
func (*Context) SetDeliver ¶
func (*Context) SetEventManager ¶
func (c *Context) SetEventManager(em *EventManager) *Context
func (*Context) SetFeeSplitInfo ¶
func (c *Context) SetFeeSplitInfo(f *FeeSplitInfo) *Context
func (*Context) SetGasMeter ¶
func (*Context) SetIsCheckTx ¶
func (*Context) SetIsDeliverTx ¶
func (*Context) SetIsReCheckTx ¶
SetIsReCheckTx called with true will also set true on checkTx in order to enforce the invariant that if recheckTx = true then checkTx = true as well.
func (*Context) SetIsTraceTx ¶
func (*Context) SetIsTraceTxLog ¶
func (*Context) SetIsWrappedCheckTx ¶
SetIsWrappedCheckTx called with true will also set true on checkTx in order to enforce the invariant that if recheckTx = true then checkTx = true as well.
func (*Context) SetMinGasPrices ¶
func (*Context) SetMultiStore ¶
func (c *Context) SetMultiStore(ms MultiStore) *Context
func (*Context) SetOverrideBytes ¶
func (*Context) SetParaMsg ¶
func (*Context) SetProposer ¶
func (c *Context) SetProposer(addr ConsAddress) *Context
func (*Context) SetTraceTxLogConfig ¶
func (*Context) SetTxBytes ¶
func (*Context) SetWatcher ¶
func (*Context) TraceTxLogConfig ¶
func (*Context) TransientStore ¶
TransientStore fetches a TransientStore from the MultiStore.
func (*Context) UpdateFromAccountCache ¶
func (*Context) UpdateToAccountCache ¶
func (*Context) UseParamCache ¶
func (Context) Value ¶
func (c Context) Value(key interface{}) interface{}
Value is deprecated, provided for backwards compatibility Please use
ctx.Context().Value(key)
instead of
ctx.Value(key)
func (Context) WithBlockHeight ¶
func (Context) WithIsCheckTx ¶
func (Context) WithIsReCheckTx ¶
WithIsReCheckTx called with true will also set true on checkTx in order to enforce the invariant that if recheckTx = true then checkTx = true as well.
func (Context) WithIsTraceTxLog ¶
type ContextKey ¶
type ContextKey string
ContextKey defines a type alias for a stdlib Context key.
const SdkContextKey ContextKey = "sdk-context"
SdkContextKey is the key in the context.Context which holds the sdk.Context.
type CustomizeOnStop ¶
type Dec ¶
NOTE: never use new(Dec) or else we will panic unmarshalling into the nil embedded big.Int
func GetDenomUnit ¶
GetDenomUnit returns a unit for a given denomination if it exists. A boolean is returned if the denomination is registered.
func NewDecFromBigInt ¶
create a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision
func NewDecFromBigIntWithPrec ¶
create a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision
func NewDecFromInt ¶
create a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision
func NewDecFromIntWithPrec ¶
create a new Dec from big integer with decimal place at prec CONTRACT: prec <= Precision
func NewDecFromStr ¶
create a decimal from an input decimal string. valid must come in the form:
(-) whole integers (.) decimal integers
examples of acceptable input include:
-123.456 456.7890 345 -456789
NOTE - An error will return if more decimal places are provided in the string than the constant Precision.
CONTRACT - This function does not mutate the input str.
func NewDecWithBigIntAndPrec ¶
NewDecWithBigIntAndPrec create a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision The new Dec takes ownership of i, and the caller should not use i after this call
func NewDecWithPrec ¶
create a new Dec from integer with decimal place at prec CONTRACT: prec <= Precision
func SmallestDec ¶
func SmallestDec() Dec
func (Dec) ApproxRoot ¶
ApproxRoot returns an approximate estimation of a Dec's positive real nth root using Newton's method (where n is positive). The algorithm starts with some guess and computes the sequence of improved guesses until an answer converges to an approximate answer. It returns `|d|.ApproxRoot() * -1` if input is negative. A maximum number of 100 iterations is used a backup boundary condition for cases where the answer never converges enough to satisfy the main condition.
func (Dec) ApproxSqrt ¶
ApproxSqrt is a wrapper around ApproxRoot for the common special case of finding the square root of a number. It returns -(sqrt(abs(d)) if input is negative.
func (Dec) Ceil ¶
Ceil returns the smallest interger value (as a decimal) that is greater than or equal to the given decimal.
func (Dec) IsNegative ¶
func (Dec) IsNil ¶
______________________________________________________________________________________________ nolint
func (Dec) IsPositive ¶
func (Dec) MarshalJSON ¶
MarshalJSON marshals the decimal
func (Dec) MarshalToAmino ¶
func (Dec) MarshalYAML ¶
MarshalYAML returns Ythe AML representation.
func (Dec) MulInt64To ¶
MulInt64To - multiplication with int64 and store result in d2
func (Dec) RoundDecimal ¶
Round a decimal with precision, perform bankers rounding (gaussian rounding)
func (Dec) RoundInt64 ¶
RoundInt64 rounds the decimal using bankers rounding
func (Dec) TruncateDec ¶
TruncateDec truncates the decimals from the number and returns a Dec
func (Dec) TruncateInt ¶
TruncateInt truncates the decimals from the number and returns an Int
func (Dec) TruncateInt64 ¶
TruncateInt64 truncates the decimals from the number and returns an int64
func (Dec) TruncateWithPrec ¶
TruncateWithPrec truncates an integer based on precision
func (*Dec) UnmarshalAmino ¶
requires a valid JSON string - strings quotes and calls UnmarshalText
func (*Dec) UnmarshalFromAmino ¶
func (*Dec) UnmarshalJSON ¶
UnmarshalJSON defines custom decoding scheme
type DecCoin ¶
DecCoin defines a coin which can have additional decimal points
func ConvertDecCoin ¶
ConvertDecCoin attempts to convert a decimal coin to a given denomination. If the given denomination is invalid or if neither denomination is registered, an error is returned.
func IBCParseDecCoin ¶
func NewDecCoin ¶
NewDecCoin creates a new DecCoin instance from an Int.
func NewDecCoinFromCoin ¶
NewDecCoinFromCoin creates a new DecCoin from a Coin.
func NewDecCoinFromDec ¶
NewDecCoinFromDec creates a new DecCoin instance from a Dec.
func NewIBCCoin ¶
func NewIBCDecCoin ¶
func NewInt64DecCoin ¶
NewInt64DecCoin returns a new DecCoin with a denomination and amount. It will panic if the amount is negative or denom is invalid.
func NormalizeDecCoin ¶
NormalizeDecCoin try to convert a decimal coin to the smallest unit registered, returns original one if failed.
func ParseDecCoin ¶
ParseDecCoin parses a decimal coin from a string, returning an error if invalid. An empty string is considered invalid.
func (DecCoin) IsGTE ¶
IsGTE returns true if they are the same type and the receiver is an equal or greater value.
func (DecCoin) IsLT ¶
IsLT returns true if they are the same type and the receiver is a smaller value.
func (DecCoin) IsNegative ¶
IsNegative returns true if the coin amount is negative and false otherwise.
TODO: Remove once unsigned integers are used.
func (DecCoin) IsPositive ¶
IsPositive returns true if coin amount is positive.
TODO: Remove once unsigned integers are used.
func (DecCoin) IsValid ¶
IsValid returns true if the DecCoin has a non-negative amount and the denom is vaild.
func (DecCoin) MarshalAminoTo ¶
func (DecCoin) MarshalToAmino ¶
func (DecCoin) String ¶
String implements the Stringer interface for DecCoin. It returns a human-readable representation of a decimal coin.
func (DecCoin) TruncateDecimal ¶
TruncateDecimal returns a Coin with a truncated decimal and a DecCoin for the change. Note, the change may be zero.
func (DecCoin) TruncateWithPrec ¶
TruncateWithPrec returns a Coin with a truncated coin and a DecCoin for the change with prec, Note, the change may be zero.
func (*DecCoin) UnmarshalFromAmino ¶
type DecCoinAdapter ¶
type DecCoinAdapter struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` Amount Dec `protobuf:"bytes,2,opt,name=amount,proto3,customtype=Dec" json:"amount"` }
DecCoinAdapter defines a token with a denomination and a decimal amount.
NOTE: The amount field is an Dec which implements the custom method signatures required by gogoproto.
func (*DecCoinAdapter) Descriptor ¶
func (*DecCoinAdapter) Descriptor() ([]byte, []int)
func (*DecCoinAdapter) Equal ¶
func (this *DecCoinAdapter) Equal(that interface{}) bool
func (*DecCoinAdapter) GetDenom ¶
func (m *DecCoinAdapter) GetDenom() string
func (*DecCoinAdapter) Marshal ¶
func (m *DecCoinAdapter) Marshal() (dAtA []byte, err error)
func (*DecCoinAdapter) MarshalToSizedBuffer ¶
func (m *DecCoinAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*DecCoinAdapter) ProtoMessage ¶
func (*DecCoinAdapter) ProtoMessage()
func (*DecCoinAdapter) Reset ¶
func (m *DecCoinAdapter) Reset()
func (*DecCoinAdapter) Size ¶
func (m *DecCoinAdapter) Size() (n int)
func (DecCoinAdapter) String ¶
func (coin DecCoinAdapter) String() string
func (*DecCoinAdapter) Unmarshal ¶
func (m *DecCoinAdapter) Unmarshal(dAtA []byte) error
func (*DecCoinAdapter) XXX_DiscardUnknown ¶
func (m *DecCoinAdapter) XXX_DiscardUnknown()
func (*DecCoinAdapter) XXX_Marshal ¶
func (m *DecCoinAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DecCoinAdapter) XXX_Merge ¶
func (m *DecCoinAdapter) XXX_Merge(src proto.Message)
func (*DecCoinAdapter) XXX_Size ¶
func (m *DecCoinAdapter) XXX_Size() int
func (*DecCoinAdapter) XXX_Unmarshal ¶
func (m *DecCoinAdapter) XXX_Unmarshal(b []byte) error
type DecCoins ¶
type DecCoins []DecCoin
DecCoins defines a slice of coins with decimal values
func NewDecCoins ¶
NewDecCoins constructs a new coin set with with decimal values from DecCoins.
func NewDecCoinsFromCoins ¶
NewDecCoinsFromCoin constructs a new coin set with decimal values from regular Coins.
func NewDecCoinsFromDec ¶
func ParseDecCoins ¶
ParseDecCoins will parse out a list of decimal coins separated by commas. If nothing is provided, it returns nil DecCoins. Returned decimal coins are sorted.
func (DecCoins) Add ¶
Add adds two sets of DecCoins.
NOTE: Add operates under the invariant that coins are sorted by denominations.
CONTRACT: Add will never return Coins where one Coin has a non-positive amount. In otherwords, IsValid will always return true.
func (DecCoins) GetDenomByIndex ¶
GetDenomByIndex returns the Denom to make the findDup generic
func (DecCoins) Intersect ¶
Intersect will return a new set of coins which contains the minimum DecCoin for common denoms found in both `coins` and `coinsB`. For denoms not common to both `coins` and `coinsB` the minimum is considered to be 0, thus they are not added to the final set.In other words, trim any denom amount from coin which exceeds that of coinB, such that (coin.Intersect(coinB)).IsLTE(coinB).
func (DecCoins) IsAllPositive ¶
IsAllPositive returns true if there is at least one coin and all currencies have a positive value.
TODO: Remove once unsigned integers are used.
func (DecCoins) IsAnyNegative ¶
IsAnyNegative returns true if there is at least one coin whose amount is negative; returns false otherwise. It returns false if the DecCoins set is empty too.
TODO: Remove once unsigned integers are used.
func (DecCoins) IsValid ¶
IsValid asserts the DecCoins are sorted, have positive amount, and Denom does not contain upper case characters.
func (DecCoins) MulDec ¶
MulDec multiplies all the coins by a decimal.
CONTRACT: No zero coins will be returned.
func (DecCoins) MulDecTruncate ¶
MulDecTruncate multiplies all the decimal coins by a decimal, truncating. It panics if d is zero.
CONTRACT: No zero coins will be returned.
func (DecCoins) QuoDec ¶
QuoDec divides all the decimal coins by a decimal. It panics if d is zero.
CONTRACT: No zero coins will be returned.
func (DecCoins) QuoDecTruncate ¶
QuoDecTruncate divides all the decimal coins by a decimal, truncating. It panics if d is zero.
CONTRACT: No zero coins will be returned.
func (DecCoins) SafeSub ¶
SafeSub performs the same arithmetic as Sub but returns a boolean if any negative coin amount was returned.
func (DecCoins) String ¶
String implements the Stringer interface for DecCoins. It returns a human-readable representation of decimal coins.
func (DecCoins) TruncateDecimal ¶
TruncateDecimal returns the coins with truncated decimals and returns the change. Note, it will not return any zero-amount coins in either the truncated or change coins.
func (DecCoins) TruncateWithPrec ¶
TruncateWithPrec returns the coins with truncated fix coins and returns the change with prec. Note, it will not return any zero-amount coins in either the truncated or change coins.
type DecProtoAdapter ¶
type DecProtoAdapter struct {
Dec Dec `protobuf:"bytes,1,opt,name=dec,proto3,customtype=Dec" json:"dec"`
}
DecProtoAdapter defines a Protobuf wrapper around a Dec object.
func (*DecProtoAdapter) Descriptor ¶
func (*DecProtoAdapter) Descriptor() ([]byte, []int)
func (*DecProtoAdapter) Marshal ¶
func (m *DecProtoAdapter) Marshal() (dAtA []byte, err error)
func (*DecProtoAdapter) MarshalToSizedBuffer ¶
func (m *DecProtoAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*DecProtoAdapter) ProtoMessage ¶
func (*DecProtoAdapter) ProtoMessage()
func (*DecProtoAdapter) Reset ¶
func (m *DecProtoAdapter) Reset()
func (*DecProtoAdapter) Size ¶
func (m *DecProtoAdapter) Size() (n int)
func (DecProtoAdapter) String ¶
func (dp DecProtoAdapter) String() string
func (*DecProtoAdapter) Unmarshal ¶
func (m *DecProtoAdapter) Unmarshal(dAtA []byte) error
func (*DecProtoAdapter) XXX_DiscardUnknown ¶
func (m *DecProtoAdapter) XXX_DiscardUnknown()
func (*DecProtoAdapter) XXX_Marshal ¶
func (m *DecProtoAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DecProtoAdapter) XXX_Merge ¶
func (m *DecProtoAdapter) XXX_Merge(src proto.Message)
func (*DecProtoAdapter) XXX_Size ¶
func (m *DecProtoAdapter) XXX_Size() int
func (*DecProtoAdapter) XXX_Unmarshal ¶
func (m *DecProtoAdapter) XXX_Unmarshal(b []byte) error
type DynamicGasInfo ¶
type DynamicGasInfo struct {
// contains filtered or unexported fields
}
func NewDynamicGasInfo ¶
func NewDynamicGasInfo(gp *big.Int, gu uint64) DynamicGasInfo
func NewEmptyDynamicGasInfo ¶
func NewEmptyDynamicGasInfo() DynamicGasInfo
func (DynamicGasInfo) GetGP ¶
func (info DynamicGasInfo) GetGP() *big.Int
func (DynamicGasInfo) GetGU ¶
func (info DynamicGasInfo) GetGU() uint64
func (*DynamicGasInfo) SetGP ¶
func (info *DynamicGasInfo) SetGP(gp *big.Int)
func (*DynamicGasInfo) SetGU ¶
func (info *DynamicGasInfo) SetGU(gu uint64)
type EmptyWatcher ¶
type EmptyWatcher struct { }
func (EmptyWatcher) DeleteAccount ¶
func (e EmptyWatcher) DeleteAccount(account interface{})
func (EmptyWatcher) DeleteContractBlockedList ¶
func (e EmptyWatcher) DeleteContractBlockedList(addr interface{})
func (EmptyWatcher) DeleteContractDeploymentWhitelist ¶
func (e EmptyWatcher) DeleteContractDeploymentWhitelist(addr interface{})
func (EmptyWatcher) Destruct ¶
func (e EmptyWatcher) Destruct() []WatchMessage
func (EmptyWatcher) Enabled ¶
func (e EmptyWatcher) Enabled() bool
func (EmptyWatcher) Finalize ¶
func (e EmptyWatcher) Finalize()
func (EmptyWatcher) SaveAccount ¶
func (e EmptyWatcher) SaveAccount(account interface{})
func (EmptyWatcher) SaveContractBlockedListItem ¶
func (e EmptyWatcher) SaveContractBlockedListItem(addr interface{})
func (EmptyWatcher) SaveContractCode ¶
func (e EmptyWatcher) SaveContractCode(addr common.Address, code []byte, height uint64)
func (EmptyWatcher) SaveContractCodeByHash ¶
func (e EmptyWatcher) SaveContractCodeByHash(hash []byte, code []byte)
func (EmptyWatcher) SaveContractDeploymentWhitelistItem ¶
func (e EmptyWatcher) SaveContractDeploymentWhitelistItem(addr interface{})
func (EmptyWatcher) SaveContractMethodBlockedListItem ¶
func (e EmptyWatcher) SaveContractMethodBlockedListItem(addr interface{}, methods []byte)
type EndBlocker ¶
type EndBlocker func(ctx Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker runs code after the transactions in a block and return updates to the validator set
Note: applications which set create_empty_blocks=false will not have regular block timing and should use e.g. BFT timestamps rather than block height for any periodic EndBlock logic
type EnvRegexp ¶
func (*EnvRegexp) FindStringSubmatch ¶
type EnvelopedErr ¶
type EnvelopedErr struct {
Err Error
}
func ErrGasOverflow ¶
func ErrGasOverflow(msg string) EnvelopedErr
func ErrInsufficientCoins ¶
func ErrInsufficientCoins(msg string) EnvelopedErr
func ErrInsufficientFee ¶
func ErrInsufficientFee(msg string) EnvelopedErr
func ErrInsufficientFunds ¶
func ErrInsufficientFunds(msg string) EnvelopedErr
func ErrInternal ¶
func ErrInternal(msg string) EnvelopedErr
func ErrInvalidAddress ¶
func ErrInvalidAddress(msg string) EnvelopedErr
func ErrInvalidCoins ¶
func ErrInvalidCoins(msg string) EnvelopedErr
func ErrInvalidPubKey ¶
func ErrInvalidPubKey(msg string) EnvelopedErr
func ErrInvalidSequence ¶
func ErrInvalidSequence(msg string) EnvelopedErr
func ErrMemoTooLarge ¶
func ErrMemoTooLarge(msg string) EnvelopedErr
func ErrNoSignatures ¶
func ErrNoSignatures(msg string) EnvelopedErr
func ErrOutOfGas ¶
func ErrOutOfGas(msg string) EnvelopedErr
func ErrTooManySignatures ¶
func ErrTooManySignatures(msg string) EnvelopedErr
func ErrTxDecode ¶
func ErrTxDecode(msg string) EnvelopedErr
func ErrUnauthorized ¶
func ErrUnauthorized(msg string) EnvelopedErr
func ErrUnknownAddress ¶
func ErrUnknownAddress(msg string) EnvelopedErr
func ErrUnknownRequest ¶
func ErrUnknownRequest(msg string) EnvelopedErr
func (EnvelopedErr) ABCICode ¶
func (e EnvelopedErr) ABCICode() uint32
func (EnvelopedErr) Codespace ¶
func (e EnvelopedErr) Codespace() string
func (EnvelopedErr) Error ¶
func (err EnvelopedErr) Error() string
func (EnvelopedErr) Result ¶
func (err EnvelopedErr) Result() (*Result, error)
type Event ¶
Event is a type alias for an ABCI Event
func NewEvent ¶
NewEvent creates a new Event object with a given type and slice of one or more attributes.
func (Event) AppendAttributes ¶
AppendAttributes adds one or more attributes to an Event.
type EventManager ¶
type EventManager struct {
// contains filtered or unexported fields
}
EventManager implements a simple wrapper around a slice of Event objects that can be emitted from.
func NewEventManager ¶
func NewEventManager() *EventManager
func (EventManager) ABCIEvents ¶
func (em EventManager) ABCIEvents() []abci.Event
ABCIEvents returns all stored Event objects as abci.Event objects.
func (*EventManager) EmitEvent ¶
func (em *EventManager) EmitEvent(event Event)
EmitEvent stores a single Event object.
func (*EventManager) EmitEvents ¶
func (em *EventManager) EmitEvents(events Events)
EmitEvents stores a series of Event objects.
func (*EventManager) Events ¶
func (em *EventManager) Events() Events
type Events ¶
type Events []Event
Events defines a slice of Event objects
func (Events) AppendEvent ¶
AppendEvent adds an Event to a slice of events.
func (Events) AppendEvents ¶
AppendEvents adds a slice of Event objects to an exist slice of Event objects.
func (Events) ToABCIEvents ¶
ToABCIEvents converts a slice of Event objects to a slice of abci.Event objects.
type EvmSysContractAddressHandler ¶
type EvmSysContractAddressHandler func(ctx Context, addr AccAddress) bool
type EvmWatcherCollector ¶
type EvmWatcherCollector func(...IWatcher)
type FeeSplitInfo ¶
type FeeSplitInfo struct { Addr AccAddress Fee Coins HasFee bool }
type GasInfo ¶
type GasInfo struct { // GasWanted is the maximum units of work we allow this tx to perform. GasWanted uint64 // GasUsed is the amount of gas actually consumed. GasUsed uint64 }
GasInfo defines tx execution gas context.
type GetTxFeeAndFromHandler ¶
type GetTxFeeHandler ¶
type HeightSensitive ¶
type IWatcher ¶
type IWatcher interface { Enabled() bool SaveContractCode(addr common.Address, code []byte, height uint64) SaveContractCodeByHash(hash []byte, code []byte) SaveAccount(account interface{}) DeleteAccount(account interface{}) SaveState(addr common.Address, key, value []byte) SaveContractBlockedListItem(addr interface{}) SaveContractMethodBlockedListItem(addr interface{}, methods []byte) SaveContractDeploymentWhitelistItem(addr interface{}) DeleteContractBlockedList(addr interface{}) DeleteContractDeploymentWhitelist(addr interface{}) Finalize() Destruct() []WatchMessage }
type InitChainer ¶
type InitChainer func(ctx Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer initializes application state at genesis
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
Int wraps integer with 256 bit range bound Checks overflow, underflow and division by zero Exists in range from -(2^maxBitLen-1) to 2^maxBitLen-1
func NewIntFromBigInt ¶
NewIntFromBigInt constructs Int from big.Int
func NewIntFromString ¶
NewIntFromString constructs Int from string
func NewIntFromUint64 ¶
NewIntFromUint64 constructs an Int from a uint64.
func NewIntWithDecimal ¶
NewIntWithDecimal constructs Int with decimal Result value is n*10^dec
func TokensFromConsensusPower ¶
TokensFromConsensusPower - convert input power to tokens
func (Int) MarshalAmino ¶
MarshalAmino defines custom encoding scheme
func (Int) MarshalJSON ¶
MarshalJSON defines custom encoding scheme
func (Int) MarshalYAML ¶
MarshalYAML returns Ythe AML representation.
func (*Int) UnmarshalAmino ¶
UnmarshalAmino defines custom decoding scheme
func (*Int) UnmarshalFromAmino ¶
func (*Int) UnmarshalJSON ¶
UnmarshalJSON defines custom decoding scheme
type IntProtoAdapter ¶
type IntProtoAdapter struct {
Int Int `protobuf:"bytes,1,opt,name=int,proto3,customtype=Int" json:"int"`
}
IntProtoAdapter defines a Protobuf wrapper around an Int object.
func (*IntProtoAdapter) Descriptor ¶
func (*IntProtoAdapter) Descriptor() ([]byte, []int)
func (*IntProtoAdapter) Marshal ¶
func (m *IntProtoAdapter) Marshal() (dAtA []byte, err error)
func (*IntProtoAdapter) MarshalToSizedBuffer ¶
func (m *IntProtoAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*IntProtoAdapter) ProtoMessage ¶
func (*IntProtoAdapter) ProtoMessage()
func (*IntProtoAdapter) Reset ¶
func (m *IntProtoAdapter) Reset()
func (*IntProtoAdapter) Size ¶
func (m *IntProtoAdapter) Size() (n int)
func (IntProtoAdapter) String ¶
func (ip IntProtoAdapter) String() string
func (*IntProtoAdapter) Unmarshal ¶
func (m *IntProtoAdapter) Unmarshal(dAtA []byte) error
func (*IntProtoAdapter) XXX_DiscardUnknown ¶
func (m *IntProtoAdapter) XXX_DiscardUnknown()
func (*IntProtoAdapter) XXX_Marshal ¶
func (m *IntProtoAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*IntProtoAdapter) XXX_Merge ¶
func (m *IntProtoAdapter) XXX_Merge(src proto.Message)
func (*IntProtoAdapter) XXX_Size ¶
func (m *IntProtoAdapter) XXX_Size() int
func (*IntProtoAdapter) XXX_Unmarshal ¶
func (m *IntProtoAdapter) XXX_Unmarshal(b []byte) error
type Invariant ¶
An Invariant is a function which tests a particular invariant. The invariant returns a descriptive message about what happened and a boolean indicating whether the invariant has been broken. The simulator will then halt and print the logs.
type InvariantRegistry ¶
expected interface for registering invariants
type Iterator ¶
nolint - reexport
func KVStorePrefixIterator ¶
Iterator over all the keys with a certain prefix in ascending order
func KVStorePrefixIteratorPaginated ¶
KVStorePrefixIteratorPaginated returns iterator over items in the selected page. Items iterated and skipped in ascending order.
func KVStoreReversePrefixIterator ¶
Iterator over all the keys with a certain prefix in descending order.
type KVStoreKey ¶
type KVStoreKey = types.KVStoreKey
nolint - reexport
func NewKVStoreKey ¶
func NewKVStoreKey(name string) *KVStoreKey
NewKVStoreKey returns a new pointer to a KVStoreKey. Use a pointer so keys don't collide.
type ModuleAccount ¶
type MptCommitHandler ¶
type MptCommitHandler func(ctx Context)
type Msg ¶
type Msg interface { // Return the message type. // Must be alphanumeric or empty. Route() string // Returns a human-readable string for the message, intended for utilization // within tags Type() string // ValidateBasic does a simple validation check that // doesn't require access to any other information. ValidateBasic() error // Get the canonical byte representation of the Msg. GetSignBytes() []byte // Signers returns the addrs of signers that must sign. // CONTRACT: All signatures must be present to be valid. // CONTRACT: Returns addrs in some deterministic order. GetSigners() []AccAddress }
Transactions messages must fulfill the Msg
type MsgAdapter ¶
type MsgProtoAdapter ¶
type MsgProtoAdapter interface { Msg codec.ProtoMarshaler }
type MsgRequest ¶
type MsgRequest interface { proto.Message // ValidateBasic does a simple validation check that // doesn't require access to any other information. ValidateBasic() error // Signers returns the addrs of signers that must sign. // CONTRACT: All signatures must be present to be valid. // CONTRACT: Returns addrs in some deterministic order. GetSigners() []AccAddress }
MsgRequest is the interface a transaction message, defined as a proto service method, must fulfill.
type MultiStorePersistentCache ¶
type MultiStorePersistentCache = types.MultiStorePersistentCache
nolint - reexport
type PeerFilter ¶
type PeerFilter func(info string) abci.ResponseQuery
PeerFilter responds to p2p filtering queries from Tendermint
type PreDeliverTxHandler ¶
type Querier ¶
Querier defines a function type that a module querier must implement to handle custom client queries.
type QueryRouter ¶
type QueryRouter interface { AddRoute(r string, h Querier) QueryRouter Route(path string) Querier }
QueryRouter provides queryables for each query path.
type QueryTraceTx ¶
type Result ¶
type Result struct { // Data is any data returned from message or handler execution. It MUST be length // prefixed in order to separate data from multiple message executions. Data []byte // Log contains the log information from message or handler execution. Log string // Events contains a slice of Event objects that were emitted during message or // handler execution. Events Events }
Result is the union of ResponseFormat and ResponseCheckTx.
func WrapServiceResult ¶
WrapServiceResult wraps a result from a protobuf RPC service method call in a Result object or error. This method takes care of marshaling the res param to protobuf and attaching any events on the ctx.EventManager() to the Result.
type ReusableGasMeter ¶
type ReusableGasMeter = types.ReusableGasMeter
nolint - reexport
func GetReusableInfiniteGasMeter ¶
func GetReusableInfiniteGasMeter() ReusableGasMeter
GetReusableInfiniteGasMeter returns a ReusableGasMeter from the pool. you must call ReturnInfiniteGasMeter after you are done with the meter.
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
type Router ¶
type Router interface { AddRoute(r string, h Handler) Router Route(ctx Context, path string) Handler }
Router provides handlers for each transaction type.
type SearchTxsResult ¶
type SearchTxsResult struct { TotalCount int `json:"total_count"` // Count of all txs Count int `json:"count"` // Count of txs in current page PageNumber int `json:"page_number"` // Index of current page, start from 1 PageTotal int `json:"page_total"` // Count of total pages Limit int `json:"limit"` // Max count txs per page Txs []TxResponse `json:"txs"` // List of txs in current page }
SearchTxsResult defines a structure for querying txs pageable
func NewSearchTxsResult ¶
func NewSearchTxsResult(totalCount, count, page, limit int, txs []TxResponse) SearchTxsResult
type ServiceMsg ¶
type ServiceMsg struct { // MethodName is the fully-qualified service method name. MethodName string // Request is the request payload. Request MsgRequest }
ServiceMsg is the struct into which an Any whose typeUrl matches a service method format (ex. `/cosmos.gov.Msg/SubmitProposal`) unpacks.
func (ServiceMsg) GetSignBytes ¶
func (msg ServiceMsg) GetSignBytes() []byte
GetSignBytes implements Msg.GetSignBytes method.
func (ServiceMsg) GetSigners ¶
func (msg ServiceMsg) GetSigners() []AccAddress
GetSigners implements Msg.GetSigners method.
func (ServiceMsg) ProtoMessage ¶
func (msg ServiceMsg) ProtoMessage()
func (ServiceMsg) Reset ¶
func (msg ServiceMsg) Reset()
func (ServiceMsg) String ¶
func (msg ServiceMsg) String() string
func (ServiceMsg) ValidateBasic ¶
func (msg ServiceMsg) ValidateBasic() error
ValidateBasic implements Msg.ValidateBasic method.
type SimulateData ¶
type SimulationResponse ¶
SimulationResponse defines the response generated when a transaction is successfully simulated by the Baseapp.
type StoreDecoderRegistry ¶
StoreDecoderRegistry defines each of the modules store decoders. Used for ImportExport simulation.
type StringEvent ¶
type StringEvent struct { Type string `json:"type,omitempty"` Attributes []Attribute `json:"attributes,omitempty"` }
StringAttribute defines en Event object wrapper where all the attributes contain key/value pairs that are strings instead of raw bytes.
func StringifyEvent ¶
func StringifyEvent(e Event) StringEvent
StringifyEvent converts an Event object to a StringEvent object.
func (StringEvent) MarshalJsonToBuffer ¶
func (e StringEvent) MarshalJsonToBuffer(buf *bytes.Buffer) error
type StringEvents ¶
type StringEvents []StringEvent
StringAttributes defines a slice of StringEvents objects.
func StringifyEvents ¶
func StringifyEvents(events []Event) StringEvents
StringifyEvents converts a slice of Event objects into a slice of StringEvent objects.
func (StringEvents) Flatten ¶
func (se StringEvents) Flatten() StringEvents
Flatten returns a flattened version of StringEvents by grouping all attributes per unique event type.
func (StringEvents) MarshalJsonToBuffer ¶
func (se StringEvents) MarshalJsonToBuffer(buf *bytes.Buffer) error
func (StringEvents) String ¶
func (se StringEvents) String() string
type Terminator ¶
type Terminator struct{}
Terminator AnteDecorator will get added to the chain to simplify decorator code Don't need to check if next == nil further up the chain
______ <((((((\\\ / . }\ ;--..--._|} (\ '--/\--' ) \\ | '-' :'| \\ . -==- .-| \\ \.__.' \--._ [\\ __.--| // _/'--. \ \\ .'-._ ('-----'/ __/ \ \ \\ / __>| | '--. | \ \\ | \ | / / / \ '\ / \ | | _/ / \ \ \ | | / / snd \ \ \ /
func (Terminator) AnteHandle ¶
func (t Terminator) AnteHandle(ctx Context, _ Tx, _ bool, _ AnteHandler) (Context, error)
Simply return provided Context and nil error
type TestMsg ¶
type TestMsg struct {
// contains filtered or unexported fields
}
TestMsg is msg type for testing
func NewTestMsg ¶
func NewTestMsg(addrs ...AccAddress) *TestMsg
func (*TestMsg) GetSignBytes ¶
func (*TestMsg) GetSigners ¶
func (msg *TestMsg) GetSigners() []AccAddress
func (*TestMsg) ValidateBasic ¶
type TestMsg2 ¶
type TestMsg2 struct {
Signers []AccAddress
}
func NewTestMsg2 ¶
func NewTestMsg2(addrs ...AccAddress) *TestMsg2
func (TestMsg2) GetSignBytes ¶
func (TestMsg2) GetSigners ¶
func (msg TestMsg2) GetSigners() []AccAddress
func (TestMsg2) ValidateBasic ¶
type TraceContext ¶
type TraceContext = types.TraceContext
TraceContext contains TraceKVStore context data. It will be written with every trace operation.
type TransactionType ¶
type TransactionType int
const ( UnknownType TransactionType = iota StdTxType EvmTxType )
func (TransactionType) String ¶
func (t TransactionType) String() (res string)
type TransientStoreKey ¶
type TransientStoreKey = types.TransientStoreKey
nolint - reexport
func NewTransientStoreKey ¶
func NewTransientStoreKey(name string) *TransientStoreKey
Constructs new TransientStoreKey Must return a pointer according to the ocap principle
type Tx ¶
type Tx interface { // Gets the all the transaction's messages. GetMsgs() []Msg // ValidateBasic does a simple and lightweight validation check that doesn't // require access to any other information. ValidateBasic() error // Return tx gas price GetGasPrice() *big.Int // Return tx call function signature GetTxFnSignatureInfo() ([]byte, int) GetType() TransactionType GetSigners() []AccAddress GetGas() uint64 GetRaw() []byte GetFrom() string GetSender(ctx Context) string GetNonce() uint64 TxHash() []byte SetRaw([]byte) SetTxHash([]byte) }
Transactions objects must fulfill the Tx
type TxAdapter ¶
type TxAdapter interface { Tx HeightSensitive }
type TxDecoder ¶
__________________________________________________________ TxDecoder unmarshals transaction bytes
type TxResponse ¶
type TxResponse struct { Height int64 `json:"height"` TxHash string `json:"txhash"` Codespace string `json:"codespace,omitempty"` Code uint32 `json:"code,omitempty"` Data string `json:"data,omitempty"` RawLog string `json:"raw_log,omitempty"` Logs ABCIMessageLogs `json:"logs,omitempty"` Info string `json:"info,omitempty"` GasWanted int64 `json:"gas_wanted,omitempty"` GasUsed int64 `json:"gas_used,omitempty"` Tx Tx `json:"tx,omitempty"` Timestamp string `json:"timestamp,omitempty"` }
TxResponse defines a structure containing relevant tx data and metadata. The tags are stringified and the log is JSON decoded.
func NewResponseFormatBroadcastTx ¶
func NewResponseFormatBroadcastTx(res *ctypes.ResultBroadcastTx) TxResponse
NewResponseFormatBroadcastTx returns a TxResponse given a ResultBroadcastTx from tendermint
func NewResponseFormatBroadcastTxCommit ¶
func NewResponseFormatBroadcastTxCommit(res *ctypes.ResultBroadcastTxCommit) TxResponse
NewResponseFormatBroadcastTxCommit returns a TxResponse given a ResultBroadcastTxCommit from tendermint.
func NewResponseResultTx ¶
func NewResponseResultTx(res *ctypes.ResultTx, tx Tx, timestamp string) TxResponse
NewResponseResultTx returns a TxResponse given a ResultTx from tendermint
func (TxResponse) Empty ¶
func (r TxResponse) Empty() bool
Empty returns true if the response is empty
func (TxResponse) String ¶
func (r TxResponse) String() string
type Uint ¶
type Uint struct {
// contains filtered or unexported fields
}
Uint wraps integer with 256 bit range bound Checks overflow, underflow and division by zero Exists in range from 0 to 2^256-1
func NewUintFromBigInt ¶
NewUintFromBigUint constructs Uint from big.Uint
func NewUintFromString ¶
NewUintFromString constructs Uint from string
func RelativePow ¶
RelativePow raises x to the power of n, where x (and the result, z) are scaled by factor b for example, RelativePow(210, 2, 100) = 441 (2.1^2 = 4.41)
func (Uint) MarshalAmino ¶
MarshalAmino defines custom encoding scheme
func (Uint) MarshalJSON ¶
MarshalJSON defines custom encoding scheme
func (*Uint) UnmarshalAmino ¶
UnmarshalAmino defines custom decoding scheme
func (*Uint) UnmarshalJSON ¶
UnmarshalJSON defines custom decoding scheme
type UpdateFeeCollectorAccHandler ¶
type UpdateFeeCollectorAccHandler func(ctx Context, balance Coins, txFeesplit []*FeeSplitInfo) error
type UpdateFeeSplitHandler ¶
type UpdateFeeSplitHandler func(txHash common.Hash, addr AccAddress, fee Coins, isDelete bool)
type UpdateGPOHandler ¶
type UpdateGPOHandler func(dynamicGpInfos []DynamicGasInfo)
type ValAddress ¶
type ValAddress []byte
ValAddress defines a wrapper around bytes meant to present a validator's operator. When marshaled to a string or JSON, it uses Bech32.
func ValAddressFromBech32 ¶
func ValAddressFromBech32(address string) (addr ValAddress, err error)
ValAddressFromBech32 creates a ValAddress from a Bech32 string.
func ValAddressFromHex ¶
func ValAddressFromHex(address string) (addr ValAddress, err error)
ValAddressFromHex creates a ValAddress from a hex string.
func (ValAddress) Empty ¶
func (va ValAddress) Empty() bool
Returns boolean for whether an AccAddress is empty
func (ValAddress) Equals ¶
func (va ValAddress) Equals(va2 Address) bool
Returns boolean for whether two ValAddresses are Equal
func (ValAddress) Format ¶
func (va ValAddress) Format(s fmt.State, verb rune)
Format implements the fmt.Formatter interface. nolint: errcheck
func (ValAddress) Marshal ¶
func (va ValAddress) Marshal() ([]byte, error)
Marshal returns the raw address bytes. It is needed for protobuf compatibility.
func (ValAddress) MarshalJSON ¶
func (va ValAddress) MarshalJSON() ([]byte, error)
MarshalJSON marshals to JSON using Bech32.
func (ValAddress) MarshalYAML ¶
func (va ValAddress) MarshalYAML() (interface{}, error)
MarshalYAML marshals to YAML using Bech32.
func (ValAddress) String ¶
func (va ValAddress) String() string
String implements the Stringer interface.
func (*ValAddress) Unmarshal ¶
func (va *ValAddress) Unmarshal(data []byte) error
Unmarshal sets the address to the given data. It is needed for protobuf compatibility.
func (*ValAddress) UnmarshalJSON ¶
func (va *ValAddress) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals from JSON assuming Bech32 encoding.
func (*ValAddress) UnmarshalYAML ¶
func (va *ValAddress) UnmarshalYAML(data []byte) error
UnmarshalYAML unmarshals from YAML assuming Bech32 encoding.
type WatchMessage ¶
Source Files ¶
- abci.go
- address.go
- address_exchain.go
- address_oec.go
- aliase_coin_exchain.go
- bytes.go
- cache.go
- codec.go
- coin.go
- coin.pb.go
- coin_adapter.go
- coin_ibc.go
- config.go
- context.go
- dec_coin.go
- decimal.go
- denom.go
- denom_ibc.go
- errors_exchain.go
- events.go
- gasprice.go
- handler.go
- ibc_adapter.go
- int.go
- invariant.go
- querier.go
- queryable.go
- result.go
- router.go
- service_msg.go
- staking.go
- store.go
- string.go
- tx_msg.go
- tx_msg_adapter.go
- uint.go
- utils.go
Directories ¶
Path | Synopsis |
---|---|
Package errors implements custom error interfaces for cosmos-sdk.
|
Package errors implements custom error interfaces for cosmos-sdk. |
Package module contains application module patterns and associated "manager" functionality.
|
Package module contains application module patterns and associated "manager" functionality. |
Package rest provides HTTP types and primitives for REST requests validation and responses handling.
|
Package rest provides HTTP types and primitives for REST requests validation and responses handling. |
Package tx is a reverse proxy.
|
Package tx is a reverse proxy. |