Documentation ¶
Index ¶
- Constants
- Variables
- func AccPubKeyString(pubkey crypto.PubKey) (string, error)
- func AddUint64Overflow(a, b uint64) (uint64, bool)
- func AppendMsgToErr(msg string, err string) string
- func Bool2Byte(in bool) []byte
- func CheckQscName(qscName string) bool
- func CodeToDefaultMsg(code CodeType) string
- func ConsensusPubKeyString(pubkey crypto.PubKey) (string, error)
- func DecoderTx(cdc *go_amino.Codec, txBytes []byte) (Tx, Error)
- func DiffKVStores(a KVStore, b KVStore, prefixesToSkip [][]byte) (kvA cmn.KVPair, kvB cmn.KVPair, count int64, equal bool)
- func FormatTimeBytes(t time.Time) []byte
- func GetAccPubKeyBech32(pubkey string) (pk crypto.PubKey, err error)
- func GetChainID(rootDir string) (string, error)
- func GetConsensusPubKeyBech32(pubkey string) (pk crypto.PubKey, err error)
- func GetFromBech32(bech32str, prefix string) ([]byte, error)
- func GetGenesisDoc(rootDir string) (*tmtypes.GenesisDoc, error)
- func GetValidatorPubKeyBech32(pubkey string) (pk crypto.PubKey, err error)
- func InclusiveEndBytes(inclusiveBytes []byte) (exclusiveBytes []byte)
- func Int2Byte(in int64) []byte
- func IntEq(t *testing.T, exp, got BigInt) (*testing.T, bool, string, string, string)
- func MustAccPubKeyString(pubkey crypto.PubKey) string
- func MustConsensusPubKeyString(pubkey crypto.PubKey) string
- func MustSortJSON(toSortJSON []byte) []byte
- func MustValidatorPubKeyString(pubkey crypto.PubKey) string
- func ParseTimeBytes(bz []byte) (time.Time, error)
- func PrefixEndBytes(prefix []byte) []byte
- func RegisterCodec(cdc *go_amino.Codec)
- func SortJSON(toSortJSON []byte) ([]byte, error)
- func UintOverflow(x Uint) bool
- func ValidatorPubKeyString(pubkey crypto.PubKey) (string, error)
- type ABCIMessageLog
- type ABCIMessageLogs
- type AccAddress
- 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) String() string
- func (aa *AccAddress) Unmarshal(data []byte) error
- func (aa *AccAddress) UnmarshalJSON(data []byte) error
- type Address
- type AddressConfig
- func (config *AddressConfig) GetBech32AccountAddrPrefix() string
- func (config *AddressConfig) GetBech32AccountPubPrefix() string
- func (config *AddressConfig) GetBech32ConsensusAddrPrefix() string
- func (config *AddressConfig) GetBech32ConsensusPubPrefix() string
- func (config *AddressConfig) GetBech32ValidatorAddrPrefix() string
- func (config *AddressConfig) GetBech32ValidatorPubPrefix() string
- func (config *AddressConfig) GetCoinType() uint32
- func (config *AddressConfig) Seal() *AddressConfig
- func (config *AddressConfig) SetBech32PrefixForAccount(addressPrefix, pubKeyPrefix string)
- func (config *AddressConfig) SetBech32PrefixForConsensusNode(addressPrefix, pubKeyPrefix string)
- func (config *AddressConfig) SetBech32PrefixForValidator(addressPrefix, pubKeyPrefix string)
- func (config *AddressConfig) SetCoinType(coinType uint32)
- type Attribute
- type BaseCoin
- func (coin *BaseCoin) GetAmount() BigInt
- func (coin *BaseCoin) GetName() string
- func (coin *BaseCoin) IsEqual(another Coin) bool
- func (coin *BaseCoin) IsGreaterThan(another Coin) bool
- func (coin *BaseCoin) IsLessThan(another Coin) bool
- func (coin *BaseCoin) IsNegative() bool
- func (coin *BaseCoin) IsNotNegative() bool
- func (coin *BaseCoin) IsPositive() bool
- func (coin *BaseCoin) IsZero() bool
- func (coin *BaseCoin) Minus(coinB Coin) Coin
- func (coin *BaseCoin) MinusByAmount(amountminus BigInt)
- func (coin *BaseCoin) Plus(coinB Coin) Coin
- func (coin *BaseCoin) PlusByAmount(amountplus BigInt)
- func (coin *BaseCoin) SameNameAs(another Coin) bool
- func (coin *BaseCoin) SetAmount(amount BigInt)
- func (coin *BaseCoin) String() string
- type BaseCoins
- func (coins BaseCoins) AmountOf(name string) BigInt
- func (coins BaseCoins) IsEqual(coinsB BaseCoins) bool
- func (coins BaseCoins) IsGTE(coinsB BaseCoins) bool
- func (coins BaseCoins) IsLT(coinsB BaseCoins) bool
- func (coins BaseCoins) IsNotNegative() bool
- func (coins BaseCoins) IsPositive() bool
- func (coins BaseCoins) IsValid() bool
- func (coins BaseCoins) IsZero() bool
- func (coins BaseCoins) Len() int
- func (coins BaseCoins) Less(i, j int) bool
- func (coins BaseCoins) Minus(coinsB BaseCoins) BaseCoins
- func (coins BaseCoins) Negative() BaseCoins
- func (coins BaseCoins) Plus(coinsB BaseCoins) BaseCoins
- func (coins BaseCoins) Sort() BaseCoins
- func (coins BaseCoins) String() string
- func (coins BaseCoins) Swap(i, j int)
- type BigInt
- func (i BigInt) Add(i2 BigInt) (res BigInt)
- func (i BigInt) AddRaw(i2 int64) BigInt
- func (i BigInt) BigInt() *big.Int
- func (i BigInt) Div(i2 BigInt) (res BigInt)
- func (i BigInt) DivRaw(i2 int64) BigInt
- func (i BigInt) Equal(i2 BigInt) bool
- func (i BigInt) GT(i2 BigInt) bool
- func (i BigInt) Int64() int64
- func (i BigInt) IsInt64() bool
- func (bi BigInt) IsNil() bool
- func (i BigInt) IsZero() bool
- func (i BigInt) LT(i2 BigInt) bool
- func (i BigInt) MarshalAmino() (string, error)
- func (i BigInt) MarshalJSON() ([]byte, error)
- func (i BigInt) Mod(i2 BigInt) BigInt
- func (i BigInt) ModRaw(i2 int64) BigInt
- func (i BigInt) Mul(i2 BigInt) (res BigInt)
- func (i BigInt) MulRaw(i2 int64) BigInt
- func (i BigInt) Neg() (res BigInt)
- func (i BigInt) NilToZero() BigInt
- func (i BigInt) Sign() int
- func (i BigInt) String() string
- func (i BigInt) Sub(i2 BigInt) (res BigInt)
- func (i BigInt) SubRaw(i2 int64) BigInt
- func (i *BigInt) UnmarshalAmino(text string) error
- func (i *BigInt) UnmarshalJSON(bz []byte) error
- type CacheKVStore
- type CacheMultiStore
- type CacheWrap
- type CacheWrapper
- type CodeType
- type CodespaceType
- type Coin
- type CommitID
- type CommitKVStore
- type CommitMultiStore
- type CommitStore
- type Committer
- 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) String() string
- func (ca *ConsAddress) Unmarshal(data []byte) error
- func (ca *ConsAddress) UnmarshalJSON(data []byte) error
- type Error
- func ErrInsufficientCoins(msg string) Error
- func ErrInsufficientFee(msg string) Error
- func ErrInsufficientFunds(msg string) Error
- func ErrInternal(msg string) Error
- func ErrInvalidAddress(msg string) Error
- func ErrInvalidCoins(msg string) Error
- func ErrInvalidPubKey(msg string) Error
- func ErrInvalidSequence(msg string) Error
- func ErrMemoTooLarge(msg string) Error
- func ErrOutOfGas(msg string) Error
- func ErrTooManySignatures(msg string) Error
- func ErrTxDecode(msg string) Error
- func ErrUnauthorized(msg string) Error
- func ErrUnknownAddress(msg string) Error
- func ErrUnknownRequest(msg string) Error
- func NewError(codespace CodespaceType, code CodeType, format string, args ...interface{}) Error
- type ErrorGasOverflow
- type ErrorOutOfGas
- type Event
- type EventManager
- type Events
- type Gas
- type GasConfig
- type GasMeter
- type GenesisState
- type Iterator
- type KVPair
- type KVStore
- type KVStoreKey
- type MultiStore
- type PruningOptions
- type QCPConfig
- type Queryable
- type Result
- type SearchTxsResult
- type Store
- type StoreKey
- type StoreType
- type StringEvent
- type StringEvents
- type TraceContext
- type TransientStoreKey
- type Tx
- type TxResponse
- type Uint
- func (i Uint) Add(i2 Uint) (res Uint)
- func (i Uint) AddRaw(i2 uint64) Uint
- func (i Uint) BigInt() *big.Int
- func (i Uint) Div(i2 Uint) (res Uint)
- func (i Uint) DivRaw(i2 uint64) Uint
- func (i Uint) Equal(i2 Uint) bool
- func (i Uint) GT(i2 Uint) bool
- func (i Uint) IsNil() bool
- func (i Uint) IsUint64() bool
- func (i Uint) IsZero() bool
- func (i Uint) LT(i2 Uint) bool
- func (i Uint) MarshalAmino() (string, error)
- func (i Uint) MarshalJSON() ([]byte, error)
- func (i Uint) Mod(i2 Uint) Uint
- func (i Uint) ModRaw(i2 uint64) Uint
- func (i Uint) Mul(i2 Uint) (res Uint)
- func (i Uint) MulRaw(i2 uint64) Uint
- func (i Uint) NilToZero() Uint
- func (i Uint) Sign() int
- func (i Uint) String() string
- func (i Uint) Sub(i2 Uint) (res Uint)
- func (i Uint) SubRaw(i2 uint64) Uint
- func (i Uint) Uint64() uint64
- func (i *Uint) UnmarshalAmino(text string) error
- func (i *Uint) UnmarshalJSON(bz []byte) error
- 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) String() string
- func (va *ValAddress) Unmarshal(data []byte) error
- func (va *ValAddress) UnmarshalJSON(data []byte) error
Constants ¶
const ( AddrLen = 20 DefaultAccountPrefix = "qosacc" DefaultAccountPublicKeyPrefix = "qosaccpub" DefaultValidatorPrefix = "qosval" DefaultValidatorPublicKeyPrefix = "qosvalpub" DefaultConsensusPrefix = "qoscons" DefaultConsensusPubKeyPrefix = "qosconspub" )
const ( // Base error codes CodeOK CodeType = 0 CodeInternal CodeType = 1 CodeTxDecode CodeType = 2 CodeInvalidSequence CodeType = 3 CodeInsufficientFunds CodeType = 5 CodeUnknownRequest CodeType = 6 CodeInvalidAddress CodeType = 7 CodeInvalidPubKey CodeType = 8 CodeUnknownAddress CodeType = 9 CodeInsufficientCoins CodeType = 10 CodeInvalidCoins CodeType = 11 CodeOutOfGas CodeType = 12 CodeMemoTooLarge CodeType = 13 CodeInsufficientFee CodeType = 14 CodeTooManySignatures CodeType = 15 // CodespaceRoot is a codespace for error codes in this file only. // Notice that 0 is an "unset" codespace, which can be overridden with // Error.WithDefaultCodespace(). CodespaceUndefined CodespaceType = "" CodespaceRoot CodespaceType = "sdk" )
SDK error codes
const ( StoreTypeMulti = types.StoreTypeMulti StoreTypeDB = types.StoreTypeDB StoreTypeIAVL = types.StoreTypeIAVL StoreTypeTransient = types.StoreTypeTransient )
nolint - reexport
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 ( EventTypeMessage = "message" AttributeKeyAction = "action" AttributeKeyModule = "module" AttributeKeyGasPayer = "gas.payer" )
Common event types and attribute keys
Functions ¶
func AddUint64Overflow ¶ added in v0.0.10
AddUint64Overflow performs the addition operation on two uint64 integers and returns a boolean on whether or not the result overflows.
func AppendMsgToErr ¶ added in v0.0.10
appends a message to the head of the given error
func CheckQscName ¶ added in v0.0.2
功能:检查 QscName 的合法性 备注:合法(3-10个字符,数字-字母-下划线)
func CodeToDefaultMsg ¶
NOTE: Don't stringer this, we'll put better messages in later.
func ConsensusPubKeyString ¶ added in v0.2.4
func DiffKVStores ¶ added in v0.2.0
func DiffKVStores(a KVStore, b KVStore, prefixesToSkip [][]byte) (kvA cmn.KVPair, kvB cmn.KVPair, count int64, equal bool)
Compare two KVstores, return either the first key/value pair at which they differ and whether or not they are equal, skipping value comparison for a set of provided prefixes
func FormatTimeBytes ¶ added in v0.0.10
Formats a time.Time into a []byte that can be sorted
func GetAccPubKeyBech32 ¶ added in v0.2.4
func GetChainID ¶ added in v0.0.7
func GetConsensusPubKeyBech32 ¶ added in v0.2.4
func GetFromBech32 ¶ added in v0.2.4
GetFromBech32 decodes a bytestring from a Bech32 encoded string.
func GetGenesisDoc ¶ added in v0.0.7
func GetGenesisDoc(rootDir string) (*tmtypes.GenesisDoc, error)
func GetValidatorPubKeyBech32 ¶ added in v0.2.4
func InclusiveEndBytes ¶ added in v0.2.0
InclusiveEndBytes returns the []byte that would end a range query such that the input would be included
func MustAccPubKeyString ¶ added in v0.2.4
func MustConsensusPubKeyString ¶ added in v0.2.4
func MustSortJSON ¶
MustSortJSON is like SortJSON but panic if an error occurs, e.g., if the passed JSON isn't valid.
func MustValidatorPubKeyString ¶ added in v0.2.4
func ParseTimeBytes ¶ added in v0.0.10
Parses a []byte encoded using FormatTimeKey back into a time.Time
func PrefixEndBytes ¶ added in v0.2.0
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 RegisterCodec ¶ added in v0.2.4
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 UintOverflow ¶ added in v0.0.10
UintOverflow returns true if a given unsigned integer overflows and false otherwise.
Types ¶
type ABCIMessageLog ¶ added in v0.2.2
type ABCIMessageLog struct { MsgIndex uint16 `json:"msg_index"` Success bool `json:"success"` Log string `json:"log"` }
ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
type ABCIMessageLogs ¶ added in v0.2.2
type ABCIMessageLogs []ABCIMessageLog
ABCIMessageLogs represents a slice of ABCIMessageLog.
func ParseABCILogs ¶ added in v0.2.2
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) String ¶ added in v0.2.2
func (logs ABCIMessageLogs) String() (str string)
String implements the fmt.Stringer interface for the ABCIMessageLogs type.
type AccAddress ¶ added in v0.2.4
type AccAddress []byte
AccAddress: common user address
func AccAddressFromBech32 ¶ added in v0.2.4
func AccAddressFromBech32(address string) (addr AccAddress, err error)
func AccAddressFromHex ¶ added in v0.2.4
func AccAddressFromHex(address string) (addr AccAddress, err error)
func (AccAddress) Bytes ¶ added in v0.2.4
func (aa AccAddress) Bytes() []byte
Bytes returns the raw address bytes.
func (AccAddress) Empty ¶ added in v0.2.4
func (aa AccAddress) Empty() bool
Returns boolean for whether an AccAddress is empty
func (AccAddress) Equals ¶ added in v0.2.4
func (aa AccAddress) Equals(aa2 Address) bool
Returns boolean for whether two AccAddresses are Equal
func (AccAddress) Format ¶ added in v0.2.4
func (aa AccAddress) Format(s fmt.State, verb rune)
Format implements the fmt.Formatter interface.
func (AccAddress) Marshal ¶ added in v0.2.4
func (aa AccAddress) Marshal() ([]byte, error)
Marshal returns the raw address bytes. It is needed for protobuf compatibility.
func (AccAddress) MarshalJSON ¶ added in v0.2.4
func (aa AccAddress) MarshalJSON() ([]byte, error)
MarshalJSON marshals to JSON using Bech32.
func (AccAddress) String ¶ added in v0.2.4
func (aa AccAddress) String() string
String implements the Stringer interface.
func (*AccAddress) Unmarshal ¶ added in v0.2.4
func (aa *AccAddress) Unmarshal(data []byte) error
Unmarshal sets the address to the given data. It is needed for protobuf compatibility.
func (*AccAddress) UnmarshalJSON ¶ added in v0.2.4
func (aa *AccAddress) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals from JSON assuming Bech32 encoding.
type AddressConfig ¶ added in v0.2.4
type AddressConfig struct {
// contains filtered or unexported fields
}
func GetAddressConfig ¶ added in v0.2.4
func GetAddressConfig() *AddressConfig
func (*AddressConfig) GetBech32AccountAddrPrefix ¶ added in v0.2.4
func (config *AddressConfig) GetBech32AccountAddrPrefix() string
func (*AddressConfig) GetBech32AccountPubPrefix ¶ added in v0.2.4
func (config *AddressConfig) GetBech32AccountPubPrefix() string
func (*AddressConfig) GetBech32ConsensusAddrPrefix ¶ added in v0.2.4
func (config *AddressConfig) GetBech32ConsensusAddrPrefix() string
func (*AddressConfig) GetBech32ConsensusPubPrefix ¶ added in v0.2.4
func (config *AddressConfig) GetBech32ConsensusPubPrefix() string
func (*AddressConfig) GetBech32ValidatorAddrPrefix ¶ added in v0.2.4
func (config *AddressConfig) GetBech32ValidatorAddrPrefix() string
func (*AddressConfig) GetBech32ValidatorPubPrefix ¶ added in v0.2.4
func (config *AddressConfig) GetBech32ValidatorPubPrefix() string
func (*AddressConfig) GetCoinType ¶ added in v0.2.4
func (config *AddressConfig) GetCoinType() uint32
func (*AddressConfig) Seal ¶ added in v0.2.4
func (config *AddressConfig) Seal() *AddressConfig
func (*AddressConfig) SetBech32PrefixForAccount ¶ added in v0.2.4
func (config *AddressConfig) SetBech32PrefixForAccount(addressPrefix, pubKeyPrefix string)
func (*AddressConfig) SetBech32PrefixForConsensusNode ¶ added in v0.2.4
func (config *AddressConfig) SetBech32PrefixForConsensusNode(addressPrefix, pubKeyPrefix string)
func (*AddressConfig) SetBech32PrefixForValidator ¶ added in v0.2.4
func (config *AddressConfig) SetBech32PrefixForValidator(addressPrefix, pubKeyPrefix string)
func (*AddressConfig) SetCoinType ¶ added in v0.2.4
func (config *AddressConfig) SetCoinType(coinType uint32)
type Attribute ¶ added in v0.2.2
Attribute defines an attribute wrapper where the key and value are strings instead of raw bytes.
func NewAttribute ¶ added in v0.2.2
NewAttribute returns a new key/value Attribute object.
type BaseCoin ¶ added in v0.0.2
func NewBaseCoin ¶ added in v0.0.2
func NewInt64BaseCoin ¶ added in v0.0.7
func ParseCoins ¶ added in v0.0.10
func (*BaseCoin) IsGreaterThan ¶ added in v0.0.2
同名币,判断数量是否更大
func (*BaseCoin) IsLessThan ¶ added in v0.0.2
同名币,判断数量是否更小
func (*BaseCoin) IsNotNegative ¶ added in v0.0.4
判断币的数量是否为非负值
func (*BaseCoin) MinusByAmount ¶ added in v0.0.2
减掉一定数量的币
func (*BaseCoin) PlusByAmount ¶ added in v0.0.2
增加一定数量的币
func (*BaseCoin) SameNameAs ¶ added in v0.0.2
判断是否与另一币同名
type BaseCoins ¶ added in v0.0.4
type BaseCoins []*BaseCoin
BaseCoin集合
func (BaseCoins) IsNotNegative ¶ added in v0.0.4
返回coins内币种币值是否均大于等于0
func (BaseCoins) IsPositive ¶ added in v0.0.4
返回coins内币种币值是否均大于0
type BigInt ¶
type BigInt struct {
// contains filtered or unexported fields
}
BigInt wraps integer with 256 bit range bound Checks overflow, underflow and division by zero Exists in range from -(2^255-1) to 2^255-1
func NewIntFromBigInt ¶
NewIntFromBigInt constructs BigInt from big.BigInt
func NewIntFromString ¶
NewIntFromString constructs BigInt from string
func NewIntWithDecimal ¶
NewIntWithDecimal constructs BigInt with decimal Result value is n*10^dec
func (BigInt) MarshalAmino ¶
MarshalAmino defines custom encoding scheme
func (BigInt) MarshalJSON ¶
MarshalJSON defines custom encoding scheme
func (*BigInt) UnmarshalAmino ¶
UnmarshalAmino defines custom decoding scheme
func (*BigInt) UnmarshalJSON ¶
UnmarshalJSON defines custom decoding scheme
type CacheMultiStore ¶ added in v0.2.0
type CacheMultiStore = types.CacheMultiStore
nolint - reexport
type Coin ¶
type Coin interface { // getters and setters GetName() string GetAmount() BigInt SetAmount(amount BigInt) // 判断是否同种币 SameNameAs(Coin) bool String() string // 判断币的数量 IsZero() bool IsPositive() bool IsNotNegative() bool IsNegative() bool IsGreaterThan(Coin) bool IsLessThan(Coin) bool IsEqual(Coin) bool // 币的数量运算 Plus(coinB Coin) Coin Minus(coinB Coin) Coin }
币的通用接口
type CommitMultiStore ¶ added in v0.2.0
type CommitMultiStore = types.CommitMultiStore
nolint - reexport
type ConsAddress ¶ added in v0.2.4
type ConsAddress []byte
consensus address
func ConsAddressFromBech32 ¶ added in v0.2.4
func ConsAddressFromBech32(address string) (addr ConsAddress, err error)
func ConsAddressFromHex ¶ added in v0.2.4
func ConsAddressFromHex(address string) (addr ConsAddress, err error)
------------------------consensus address-----------------------
func GetConsAddress ¶ added in v0.2.4
func GetConsAddress(pubkey crypto.PubKey) ConsAddress
get ConsAddress from pubkey
func (ConsAddress) Bytes ¶ added in v0.2.4
func (ca ConsAddress) Bytes() []byte
Bytes returns the raw address bytes.
func (ConsAddress) Empty ¶ added in v0.2.4
func (ca ConsAddress) Empty() bool
Returns boolean for whether an ConsAddress is empty
func (ConsAddress) Equals ¶ added in v0.2.4
func (ca ConsAddress) Equals(ca2 Address) bool
Returns boolean for whether two ConsAddress are Equal
func (ConsAddress) Format ¶ added in v0.2.4
func (ca ConsAddress) Format(s fmt.State, verb rune)
Format implements the fmt.Formatter interface. nolint: errcheck
func (ConsAddress) Marshal ¶ added in v0.2.4
func (ca ConsAddress) Marshal() ([]byte, error)
Marshal returns the raw address bytes. It is needed for protobuf compatibility.
func (ConsAddress) MarshalJSON ¶ added in v0.2.4
func (ca ConsAddress) MarshalJSON() ([]byte, error)
MarshalJSON marshals to JSON using Bech32.
func (ConsAddress) String ¶ added in v0.2.4
func (ca ConsAddress) String() string
String implements the Stringer interface.
func (*ConsAddress) Unmarshal ¶ added in v0.2.4
func (ca *ConsAddress) Unmarshal(data []byte) error
Unmarshal sets the address to the given data. It is needed for protobuf compatibility.
func (*ConsAddress) UnmarshalJSON ¶ added in v0.2.4
func (ca *ConsAddress) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals from JSON assuming Bech32 encoding.
type Error ¶
type Error interface { // convenience TraceSDK(format string, args ...interface{}) Error // set codespace WithDefaultCodespace(CodespaceType) Error Code() CodeType Codespace() CodespaceType ABCILog() string Result() Result QueryResult() abci.ResponseQuery // contains filtered or unexported methods }
sdk Error type
func ErrInsufficientCoins ¶
func ErrInsufficientFee ¶ added in v0.0.10
func ErrInsufficientFunds ¶
func ErrInvalidAddress ¶
func ErrInvalidCoins ¶
func ErrInvalidPubKey ¶
func ErrInvalidSequence ¶
func ErrMemoTooLarge ¶
func ErrOutOfGas ¶
func ErrTooManySignatures ¶ added in v0.0.10
func ErrTxDecode ¶
func ErrUnauthorized ¶
func ErrUnknownAddress ¶
func ErrUnknownRequest ¶
type ErrorGasOverflow ¶ added in v0.0.10
type ErrorGasOverflow = types.ErrorGasOverflow
nolint - reexport
type Event ¶ added in v0.2.2
Event is a type alias for an ABCI Event
func NewEvent ¶ added in v0.2.2
NewEvent creates a new Event object with a given type and slice of one or more attributes.
func (Event) AppendAttributes ¶ added in v0.2.2
AppendAttributes adds one or more attributes to an Event.
type EventManager ¶ added in v0.2.2
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 ¶ added in v0.2.2
func NewEventManager() *EventManager
func (EventManager) ABCIEvents ¶ added in v0.2.2
func (em EventManager) ABCIEvents() []abci.Event
ABCIEvents returns all stored Event objects as abci.Event objects.
func (*EventManager) EmitEvent ¶ added in v0.2.2
func (em *EventManager) EmitEvent(event Event)
EmitEvent stores a single Event object.
func (*EventManager) EmitEvents ¶ added in v0.2.2
func (em *EventManager) EmitEvents(events Events)
EmitEvents stores a series of Event objects.
func (*EventManager) Events ¶ added in v0.2.2
func (em *EventManager) Events() Events
type Events ¶ added in v0.2.2
type Events []Event
Events defines a slice of Event objects
func EmptyEvents ¶ added in v0.2.2
func EmptyEvents() Events
EmptyEvents returns an empty slice of events.
func (Events) AppendEvent ¶ added in v0.2.2
AppendEvent adds an Event to a slice of events.
func (Events) AppendEvents ¶ added in v0.2.2
AppendEvents adds a slice of Event objects to an exist slice of Event objects.
func (Events) ToABCIEvents ¶ added in v0.2.2
ToABCIEvents converts a slice of Event objects to a slice of abci.Event objects.
type GenesisState ¶ added in v0.0.5
type GenesisState struct {
QCPs []*QCPConfig `json:"qcps"`
}
app_state in genesis.json
type Iterator ¶ added in v0.2.0
nolint - reexport
func KVStorePrefixIterator ¶ added in v0.2.0
Iterator over all the keys with a certain prefix in ascending order
func KVStoreReversePrefixIterator ¶ added in v0.2.0
Iterator over all the keys with a certain prefix in descending order.
type KVStoreKey ¶ added in v0.2.0
type KVStoreKey = types.KVStoreKey
nolint - reexport
func NewKVStoreKey ¶ added in v0.2.0
func NewKVStoreKey(name string) *KVStoreKey
NewKVStoreKey returns a new pointer to a KVStoreKey. Use a pointer so keys don't collide.
type QCPConfig ¶ added in v0.0.5
type QCPConfig struct { Name string `json:"name"` ChainId string `json:"chain_id"` PubKey crypto.PubKey `json:"pub_key"` }
QCP配置
type Result ¶
type Result struct { // Code is the response code, is stored back on the chain. Code CodeType // Codespace is the string referring to the domain of an error Codespace CodespaceType // Data is any data returned from the app. // Data has to be length prefixed in order to separate // results from multiple msgs executions Data []byte // Log contains the txs log information. NOTE: nondeterministic. Log string // GasWanted is the maximum units of work we allow this tx to perform. GasWanted uint64 // GasUsed is the amount of gas actually consumed. NOTE: unimplemented GasUsed uint64 // Events contains a slice of Event objects that were emitted during some // execution. Events Events }
Result is the union of ResponseFormat and ResponseCheckTx.
type SearchTxsResult ¶ added in v0.2.2
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 ¶ added in v0.2.2
func NewSearchTxsResult(totalCount, count, page, limit int, txs []TxResponse) SearchTxsResult
type StringEvent ¶ added in v0.2.2
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 ¶ added in v0.2.2
func StringifyEvent(e abci.Event) StringEvent
StringifyEvent converts an Event object to a StringEvent object.
type StringEvents ¶ added in v0.2.2
type StringEvents []StringEvent
StringAttributes defines a slice of StringEvents objects.
func StringifyEvents ¶ added in v0.2.2
func StringifyEvents(events []abci.Event) StringEvents
StringifyEvents converts a slice of Event objects into a slice of StringEvent objects.
func (StringEvents) Flatten ¶ added in v0.2.2
func (se StringEvents) Flatten() StringEvents
Flatten returns a flattened version of StringEvents by grouping all attributes per unique event type.
func (StringEvents) String ¶ added in v0.2.2
func (se StringEvents) String() string
type TraceContext ¶ added in v0.2.0
type TraceContext = types.TraceContext
TraceContext contains TraceKVStore context data. It will be written with every trace operation.
type TransientStoreKey ¶ added in v0.2.0
type TransientStoreKey = types.TransientStoreKey
nolint - reexport
func NewTransientStoreKey ¶ added in v0.2.0
func NewTransientStoreKey(name string) *TransientStoreKey
Constructs new TransientStoreKey Must return a pointer according to the ocap principle
type TxResponse ¶ added in v0.2.2
type TxResponse struct { Height int64 `json:"height"` TxHash string `json:"txhash"` 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"` Events StringEvents `json:"events,omitempty"` Codespace string `json:"codespace,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 ¶ added in v0.2.2
func NewResponseFormatBroadcastTx(res *ctypes.ResultBroadcastTx) TxResponse
NewResponseFormatBroadcastTx returns a TxResponse given a ResultBroadcastTx from tendermint
func NewResponseFormatBroadcastTxCommit ¶ added in v0.2.2
func NewResponseFormatBroadcastTxCommit(res *ctypes.ResultBroadcastTxCommit) TxResponse
NewResponseFormatBroadcastTxCommit returns a TxResponse given a ResultBroadcastTxCommit from tendermint.
func NewResponseResultTx ¶ added in v0.2.2
func NewResponseResultTx(res *ctypes.ResultTx, tx Tx, timestamp string) TxResponse
NewResponseResultTx returns a TxResponse given a ResultTx from tendermint
func (TxResponse) Empty ¶ added in v0.2.2
func (r TxResponse) Empty() bool
Empty returns true if the response is empty
func (TxResponse) String ¶ added in v0.2.2
func (r TxResponse) String() string
type Uint ¶
type Uint struct {
// contains filtered or unexported fields
}
BigInt 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 NewUintWithDecimal ¶
NewUintWithDecimal constructs Uint with decimal Result value is n*10^dec
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 ValAddress ¶ added in v0.2.4
type ValAddress []byte
validator address
func ValAddressFromBech32 ¶ added in v0.2.4
func ValAddressFromBech32(address string) (addr ValAddress, err error)
ValAddressFromBech32 creates a ValAddress from a Bech32 string.
func ValAddressFromHex ¶ added in v0.2.4
func ValAddressFromHex(address string) (addr ValAddress, err error)
func (ValAddress) Bytes ¶ added in v0.2.4
func (va ValAddress) Bytes() []byte
Bytes returns the raw address bytes.
func (ValAddress) Empty ¶ added in v0.2.4
func (va ValAddress) Empty() bool
Returns boolean for whether an AccAddress is empty
func (ValAddress) Equals ¶ added in v0.2.4
func (va ValAddress) Equals(va2 Address) bool
Returns boolean for whether two ValAddresses are Equal
func (ValAddress) Format ¶ added in v0.2.4
func (va ValAddress) Format(s fmt.State, verb rune)
Format implements the fmt.Formatter interface. nolint: errcheck
func (ValAddress) Marshal ¶ added in v0.2.4
func (va ValAddress) Marshal() ([]byte, error)
Marshal returns the raw address bytes. It is needed for protobuf compatibility.
func (ValAddress) MarshalJSON ¶ added in v0.2.4
func (va ValAddress) MarshalJSON() ([]byte, error)
MarshalJSON marshals to JSON using Bech32.
func (ValAddress) String ¶ added in v0.2.4
func (va ValAddress) String() string
String implements the Stringer interface.
func (*ValAddress) Unmarshal ¶ added in v0.2.4
func (va *ValAddress) Unmarshal(data []byte) error
Unmarshal sets the address to the given data. It is needed for protobuf compatibility.
func (*ValAddress) UnmarshalJSON ¶ added in v0.2.4
func (va *ValAddress) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals from JSON assuming Bech32 encoding.