Documentation ¶
Overview ¶
Package types is a generated GoMock package.
Index ¶
- Constants
- Variables
- func Bech32ifyAccPub(pub crypto.PubKey) (string, error)
- func Bech32ifyConsPub(pub crypto.PubKey) (string, error)
- func CodeToDefaultMsg(code CodeType) string
- func GetAccPubKeyBech32(pubkey string) (pk crypto.PubKey, err error)
- func GetConsPubKeyBech32(pubkey string) (pk crypto.PubKey, err error)
- func GetFromBech32(bech32str, prefix string) ([]byte, error)
- func MustBech32ifyAccPub(pub crypto.PubKey) string
- func MustBech32ifyConsPub(pub crypto.PubKey) string
- func MustSortJSON(toSortJSON []byte) []byte
- func NewDecFromStr(str string) (d Dec, err Error)
- func RegisterBasicCodec(cdc SDKCodec)
- func SortJSON(toSortJSON []byte) ([]byte, error)
- func VerifyAddressFormat(bz []byte) 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 Attribute
- type BaseClient
- type BroadcastMode
- type ClientConfig
- type ClientQuery
- type ClientTx
- type CodeType
- type Codec
- type CodespaceType
- 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
- 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 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 NewDecWithPrec(i, prec int64) Dec
- func OneDec() Dec
- func ZeroDec() Dec
- func (d Dec) Abs() Dec
- func (d Dec) Add(d2 Dec) Dec
- 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) MarshalAmino() (string, error)
- func (d Dec) MarshalJSON() ([]byte, 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) MulTruncate(d2 Dec) Dec
- func (d Dec) Neg() 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) RoundInt() Int
- func (d Dec) RoundInt64() int64
- 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) UnmarshalAmino(text string) (err error)
- func (d *Dec) UnmarshalJSON(bz []byte) error
- type DecCoin
- type DecCoins
- func (coins DecCoins) Add(coinsB DecCoins) DecCoins
- func (coins DecCoins) IsAllPositive() 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) Sort() DecCoins
- func (coins DecCoins) Swap(i, j int)
- type Error
- type Event
- type Events
- type 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) IsPositive() bool
- func (i Int) IsZero() bool
- func (i Int) LT(i2 Int) bool
- func (i Int) LTE(i2 Int) bool
- func (i Int) MarshalAmino() (string, error)
- func (i Int) MarshalJSON() ([]byte, 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) 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) UnmarshalAmino(text string) error
- func (i *Int) UnmarshalJSON(bz []byte) error
- type MockBaseClient
- func (m *MockBaseClient) Block(height *int64) (*core_types.ResultBlock, error)
- func (m *MockBaseClient) BlockResults(height *int64) (*core_types.ResultBlockResults, error)
- func (m *MockBaseClient) Broadcast(txBytes []byte, broadcastMode BroadcastMode) (TxResponse, error)
- func (m *MockBaseClient) BuildAndBroadcast(fromName, passphrase, memo string, msgs []Msg, accNumber, seqNumber uint64) (TxResponse, error)
- func (m *MockBaseClient) BuildStdTx(fromName, passphrase, memo string, msgs []Msg, accNumber, seqNumber uint64) (StdTx, error)
- func (m *MockBaseClient) BuildTxForSim(msgs []Msg, memo string, accNumber, seqNumber uint64) ([]byte, error)
- func (m *MockBaseClient) BuildUnsignedStdTxOffline(msgs []Msg, memo string) StdTx
- func (m *MockBaseClient) CalculateGas(txBytes []byte) (StdFee, error)
- func (m *MockBaseClient) Commit(height *int64) (*core_types.ResultCommit, error)
- func (m *MockBaseClient) EXPECT() *MockBaseClientMockRecorder
- func (m *MockBaseClient) GetCodec() SDKCodec
- func (m *MockBaseClient) GetConfig() ClientConfig
- func (m *MockBaseClient) Query(path string, key common.HexBytes) ([]byte, error)
- func (m *MockBaseClient) QueryStore(key common.HexBytes, storeName, endPath string) ([]byte, error)
- func (m *MockBaseClient) QuerySubspace(subspace []byte, storeName string) ([]common.KVPair, error)
- func (m *MockBaseClient) Tx(hash []byte, prove bool) (*core_types.ResultTx, error)
- func (m *MockBaseClient) TxSearch(query string, prove bool, page, perPage int) (*core_types.ResultTxSearch, error)
- func (m *MockBaseClient) Validators(height *int64) (*core_types.ResultValidators, error)
- type MockBaseClientMockRecorder
- func (mr *MockBaseClientMockRecorder) Block(height interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) BlockResults(height interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) Broadcast(txBytes, broadcastMode interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) BuildAndBroadcast(fromName, passphrase, memo, msgs, accNumber, seqNumber interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) BuildStdTx(fromName, passphrase, memo, msgs, accNumber, seqNumber interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) BuildTxForSim(msgs, memo, accNumber, seqNumber interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) BuildUnsignedStdTxOffline(msgs, memo interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) CalculateGas(txBytes interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) Commit(height interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) GetCodec() *gomock.Call
- func (mr *MockBaseClientMockRecorder) GetConfig() *gomock.Call
- func (mr *MockBaseClientMockRecorder) Query(path, key interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) QueryStore(key, storeName, endPath interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) QuerySubspace(subspace, storeName interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) Tx(hash, prove interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) TxSearch(query, prove, page, perPage interface{}) *gomock.Call
- func (mr *MockBaseClientMockRecorder) Validators(height interface{}) *gomock.Call
- type MockClientQuery
- func (m *MockClientQuery) Block(height *int64) (*core_types.ResultBlock, error)
- func (m *MockClientQuery) BlockResults(height *int64) (*core_types.ResultBlockResults, error)
- func (m *MockClientQuery) Commit(height *int64) (*core_types.ResultCommit, error)
- func (m *MockClientQuery) EXPECT() *MockClientQueryMockRecorder
- func (m *MockClientQuery) Query(path string, key common.HexBytes) ([]byte, error)
- func (m *MockClientQuery) QueryStore(key common.HexBytes, storeName, endPath string) ([]byte, error)
- func (m *MockClientQuery) QuerySubspace(subspace []byte, storeName string) ([]common.KVPair, error)
- func (m *MockClientQuery) Tx(hash []byte, prove bool) (*core_types.ResultTx, error)
- func (m *MockClientQuery) TxSearch(query string, prove bool, page, perPage int) (*core_types.ResultTxSearch, error)
- func (m *MockClientQuery) Validators(height *int64) (*core_types.ResultValidators, error)
- type MockClientQueryMockRecorder
- func (mr *MockClientQueryMockRecorder) Block(height interface{}) *gomock.Call
- func (mr *MockClientQueryMockRecorder) BlockResults(height interface{}) *gomock.Call
- func (mr *MockClientQueryMockRecorder) Commit(height interface{}) *gomock.Call
- func (mr *MockClientQueryMockRecorder) Query(path, key interface{}) *gomock.Call
- func (mr *MockClientQueryMockRecorder) QueryStore(key, storeName, endPath interface{}) *gomock.Call
- func (mr *MockClientQueryMockRecorder) QuerySubspace(subspace, storeName interface{}) *gomock.Call
- func (mr *MockClientQueryMockRecorder) Tx(hash, prove interface{}) *gomock.Call
- func (mr *MockClientQueryMockRecorder) TxSearch(query, prove, page, perPage interface{}) *gomock.Call
- func (mr *MockClientQueryMockRecorder) Validators(height interface{}) *gomock.Call
- type MockClientTx
- type MockClientTxMockRecorder
- type MockRPCClient
- func (m *MockRPCClient) ABCIInfo() (*core_types.ResultABCIInfo, error)
- func (m *MockRPCClient) ABCIQuery(path string, data common.HexBytes) (*core_types.ResultABCIQuery, error)
- func (m *MockRPCClient) ABCIQueryWithOptions(path string, data common.HexBytes, opts client.ABCIQueryOptions) (*core_types.ResultABCIQuery, error)
- func (m *MockRPCClient) Block(height *int64) (*core_types.ResultBlock, error)
- func (m *MockRPCClient) BlockResults(height *int64) (*core_types.ResultBlockResults, error)
- func (m *MockRPCClient) BroadcastTxAsync(tx types.Tx) (*core_types.ResultBroadcastTx, error)
- func (m *MockRPCClient) BroadcastTxCommit(tx types.Tx) (*core_types.ResultBroadcastTxCommit, error)
- func (m *MockRPCClient) BroadcastTxSync(tx types.Tx) (*core_types.ResultBroadcastTx, error)
- func (m *MockRPCClient) Commit(height *int64) (*core_types.ResultCommit, error)
- func (m *MockRPCClient) EXPECT() *MockRPCClientMockRecorder
- func (m *MockRPCClient) Tx(hash []byte, prove bool) (*core_types.ResultTx, error)
- func (m *MockRPCClient) TxSearch(query string, prove bool, page, perPage int) (*core_types.ResultTxSearch, error)
- func (m *MockRPCClient) Validators(height *int64) (*core_types.ResultValidators, error)
- type MockRPCClientMockRecorder
- func (mr *MockRPCClientMockRecorder) ABCIInfo() *gomock.Call
- func (mr *MockRPCClientMockRecorder) ABCIQuery(path, data interface{}) *gomock.Call
- func (mr *MockRPCClientMockRecorder) ABCIQueryWithOptions(path, data, opts interface{}) *gomock.Call
- func (mr *MockRPCClientMockRecorder) Block(height interface{}) *gomock.Call
- func (mr *MockRPCClientMockRecorder) BlockResults(height interface{}) *gomock.Call
- func (mr *MockRPCClientMockRecorder) BroadcastTxAsync(tx interface{}) *gomock.Call
- func (mr *MockRPCClientMockRecorder) BroadcastTxCommit(tx interface{}) *gomock.Call
- func (mr *MockRPCClientMockRecorder) BroadcastTxSync(tx interface{}) *gomock.Call
- func (mr *MockRPCClientMockRecorder) Commit(height interface{}) *gomock.Call
- func (mr *MockRPCClientMockRecorder) Tx(hash, prove interface{}) *gomock.Call
- func (mr *MockRPCClientMockRecorder) TxSearch(query, prove, page, perPage interface{}) *gomock.Call
- func (mr *MockRPCClientMockRecorder) Validators(height interface{}) *gomock.Call
- type MockSimulationHandler
- type MockSimulationHandlerMockRecorder
- type MockTxHandler
- func (m *MockTxHandler) BuildAndBroadcast(fromName, passphrase, memo string, msgs []Msg, accNumber, seqNumber uint64) (TxResponse, error)
- func (m *MockTxHandler) BuildStdTx(fromName, passphrase, memo string, msgs []Msg, accNumber, seqNumber uint64) (StdTx, error)
- func (m *MockTxHandler) BuildUnsignedStdTxOffline(msgs []Msg, memo string) StdTx
- func (m *MockTxHandler) EXPECT() *MockTxHandlerMockRecorder
- type MockTxHandlerMockRecorder
- func (mr *MockTxHandlerMockRecorder) BuildAndBroadcast(fromName, passphrase, memo, msgs, accNumber, seqNumber interface{}) *gomock.Call
- func (mr *MockTxHandlerMockRecorder) BuildStdTx(fromName, passphrase, memo, msgs, accNumber, seqNumber interface{}) *gomock.Call
- func (mr *MockTxHandlerMockRecorder) BuildUnsignedStdTxOffline(msgs, memo interface{}) *gomock.Call
- type Module
- type Msg
- type RPCClient
- type Result
- type SDKCodec
- type SearchTxsResult
- type SimulationHandler
- type StdFee
- type StdSignDoc
- type StdSignMsg
- type StdSignature
- type StdTx
- type StringEvent
- type StringEvents
- type Tx
- type TxDecoder
- type TxEncoder
- type TxHandler
- type TxResponse
- 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 defines a valid address length AddrLen = 20 // Bech32MainPrefix defines the Bech32 prefix of an account's address Bech32MainPrefix = "okchain" // 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" // 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 ( Precision = 8 // bytes required to represent the above precision // Ceiling[Log2[999 999 999 999 999 999]] DecimalPrecisionBits = 60 )
number of decimal places
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 CodeGasOverflow CodeType = 16 CodeNoSignatures CodeType = 17 // 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
Variables ¶
var Cdc = NewCodec()
Cdc is the codec for signing
Functions ¶
func Bech32ifyAccPub ¶
Bech32ifyAccPub returns a Bech32 encoded string containing the Bech32PrefixAccPub prefix for a given account PubKey.
func Bech32ifyConsPub ¶
Bech32ifyConsPub returns a Bech32 encoded string containing the Bech32PrefixConsPub prefixfor a given consensus node's PubKey
func CodeToDefaultMsg ¶
CodeToDefaultMsg converts code to string message NOTE: Don't stringer this, we'll put better messages in later.
func GetAccPubKeyBech32 ¶
GetAccPubKeyBech32 creates a PubKey for an account with a given public key string using the Bech32 Bech32PrefixAccPub prefix
func GetConsPubKeyBech32 ¶
GetConsPubKeyBech32 creates a PubKey for a consensus node with a given public key string using the Bech32 Bech32PrefixConsPub prefix
func GetFromBech32 ¶
GetFromBech32 decodes a bytestring from a Bech32 encoded string.
func MustBech32ifyAccPub ¶
MustBech32ifyAccPub returns the result of Bech32ifyAccPub panicing on failure.
func MustBech32ifyConsPub ¶
MustBech32ifyConsPub returns the result of Bech32ifyConsPub panicing on failure
func MustSortJSON ¶
MustSortJSON is like SortJSON but panic if an error occurs, e.g., if the passed JSON isn't valid
func NewDecFromStr ¶
NewDecFromStr creates 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 RegisterBasicCodec ¶
func RegisterBasicCodec(cdc SDKCodec)
RegisterBasicCodec registers the basic data types for gosdk codec
func SortJSON ¶
SortJSON takes any JSON and returns it sorted by keys. Also, all white-spaces are removed
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()
Types ¶
type ABCIMessageLog ¶
type ABCIMessageLog struct { MsgIndex uint16 `json:"msg_index"` Success bool `json:"success"` 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
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) 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) (addr AccAddress, err error)
AccAddressFromBech32 creates an AccAddress from a Bech32 string.
func (AccAddress) Empty ¶
func (aa AccAddress) Empty() bool
Empty returns boolean for whether an AccAddress is empty
func (AccAddress) Equals ¶
func (aa AccAddress) Equals(aa2 Address) bool
Equals 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.
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) 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.
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 Attribute ¶
Attribute defines an attribute wrapper where the key and value are strings instead of raw bytes.
type BaseClient ¶
type BaseClient interface { ClientQuery ClientTx TxHandler SimulationHandler GetCodec() SDKCodec GetConfig() ClientConfig }
BaseClient shows the expected behavior for a base client
type BroadcastMode ¶
type BroadcastMode string
BroadcastMode defines different mode to broadcast
const ( BroadcastSync BroadcastMode = "sync" BroadcastAsync BroadcastMode = "async" BroadcastBlock BroadcastMode = "commit" )
const
type ClientConfig ¶
type ClientConfig struct { NodeURI string ChainID string BroadcastMode BroadcastMode Gas uint64 GasAdjustment float64 Fees DecCoins GasPrices DecCoins }
ClientConfig records the base config of gosdk client
func NewClientConfig ¶
func NewClientConfig(nodeURI, chainID string, broadcastMode BroadcastMode, feesStr string, gas uint64, gasAdjustment float64, gasPricesStr string) ( cliConfig ClientConfig, err error)
NewClientConfig creates a new instance of ClientConfig
type ClientQuery ¶
type ClientQuery interface { rpc.SignClient Query(path string, key cmn.HexBytes) ([]byte, error) QueryStore(key cmn.HexBytes, storeName, endPath string) ([]byte, error) QuerySubspace(subspace []byte, storeName string) ([]cmn.KVPair, error) }
ClientQuery shows the expected query behavior
type ClientTx ¶
type ClientTx interface {
Broadcast(txBytes []byte, broadcastMode BroadcastMode) (res TxResponse, err error)
}
ClientTx shows the expected tx behavior
type Codec ¶
type Codec struct {
*amino.Codec
}
Codec defines the codec only for okchain gosdk
func (Codec) RegisterConcrete ¶
RegisterConcrete implements the SDKCodec interface
func (Codec) RegisterInterface ¶
func (cdc Codec) RegisterInterface(ptr interface{})
RegisterInterface implements the SDKCodec interface
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 (*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
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 (ConsAddress) Empty ¶
func (ca ConsAddress) Empty() bool
Empty returns boolean for whether an ConsAddress is empty
func (ConsAddress) Equals ¶
func (ca ConsAddress) Equals(ca2 Address) bool
Equals 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
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) 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
type Dec ¶
Dec - structure for the number with decimal values NOTE: never use new(Dec) or else we will panic unmarshalling into the nil embedded big.Int
func MustNewDecFromStr ¶
MustNewDecFromStr parses decimal from string, panic on error
func NewDecFromBigInt ¶
NewDecFromBigInt creates a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision
func NewDecFromBigIntWithPrec ¶
NewDecFromBigIntWithPrec creates a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision
func NewDecFromInt ¶
NewDecFromInt creates a new Dec from big integer assuming whole numbers CONTRACT: prec <= Precision
func NewDecFromIntWithPrec ¶
NewDecFromIntWithPrec creates a new Dec from big integer with decimal place at prec CONTRACT: prec <= Precision
func NewDecWithPrec ¶
create a new Dec from integer with decimal place at prec CONTRACT: prec <= Precision
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) IsPositive ¶
func (Dec) MarshalAmino ¶
MarshalAmino wraps d.MarshalText()
func (Dec) MarshalJSON ¶
MarshalJSON marshals the decimal
func (Dec) MulTruncate ¶
MulTruncate defines multiplication truncate
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) UnmarshalAmino ¶
UnmarshalAmino requires a valid JSON string - strings quotes and calls UnmarshalText
func (*Dec) UnmarshalJSON ¶
UnmarshalJSON defines custom decoding scheme
type DecCoin ¶
DecCoin defines a coin which can have additional decimal points
func NewDecCoinFromDec ¶
NewDecCoinFromDec returns a dec coin from a Dec number and string denom
func ParseDecCoin ¶
ParseDecCoin parses a decimal coin from a string, returning an error if invalid An empty string is considered invalid
func (DecCoin) IsNegative ¶
IsNegative returns true if the coin amount is negative and false otherwise
func (DecCoin) IsPositive ¶
IsPositive returns true if coin amount is positive
type DecCoins ¶
type DecCoins []DecCoin
DecCoins defines a slice of coins with decimal values
func NewDecCoins ¶
NewDecCoins creates a new instance of DecCoins
func ParseDecCoins ¶
ParseDecCoins parses DecCoins from string
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) IsAllPositive ¶
IsAllPositive returns true if there is at least one coin and all currencies
func (DecCoins) IsValid ¶
IsValid asserts the DecCoins are sorted, have positive amount and Denom does not contain upper case characters
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 }
Error shows the expected behavior of a sdk error type
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 (Int) MarshalAmino ¶
MarshalAmino defines custom encoding scheme
func (Int) MarshalJSON ¶
MarshalJSON defines custom encoding scheme
func (*Int) UnmarshalAmino ¶
UnmarshalAmino defines custom decoding scheme
func (*Int) UnmarshalJSON ¶
UnmarshalJSON defines custom decoding scheme
type MockBaseClient ¶
type MockBaseClient struct {
// contains filtered or unexported fields
}
MockBaseClient is a mock of BaseClient interface
func NewMockBaseClient ¶
func NewMockBaseClient(ctrl *gomock.Controller) *MockBaseClient
NewMockBaseClient creates a new mock instance
func (*MockBaseClient) Block ¶
func (m *MockBaseClient) Block(height *int64) (*core_types.ResultBlock, error)
Block mocks base method
func (*MockBaseClient) BlockResults ¶
func (m *MockBaseClient) BlockResults(height *int64) (*core_types.ResultBlockResults, error)
BlockResults mocks base method
func (*MockBaseClient) Broadcast ¶
func (m *MockBaseClient) Broadcast(txBytes []byte, broadcastMode BroadcastMode) (TxResponse, error)
Broadcast mocks base method
func (*MockBaseClient) BuildAndBroadcast ¶
func (m *MockBaseClient) BuildAndBroadcast(fromName, passphrase, memo string, msgs []Msg, accNumber, seqNumber uint64) (TxResponse, error)
BuildAndBroadcast mocks base method
func (*MockBaseClient) BuildStdTx ¶
func (m *MockBaseClient) BuildStdTx(fromName, passphrase, memo string, msgs []Msg, accNumber, seqNumber uint64) (StdTx, error)
BuildStdTx mocks base method
func (*MockBaseClient) BuildTxForSim ¶
func (m *MockBaseClient) BuildTxForSim(msgs []Msg, memo string, accNumber, seqNumber uint64) ([]byte, error)
BuildTxForSim mocks base method
func (*MockBaseClient) BuildUnsignedStdTxOffline ¶
func (m *MockBaseClient) BuildUnsignedStdTxOffline(msgs []Msg, memo string) StdTx
BuildUnsignedStdTxOffline mocks base method
func (*MockBaseClient) CalculateGas ¶
func (m *MockBaseClient) CalculateGas(txBytes []byte) (StdFee, error)
CalculateGas mocks base method
func (*MockBaseClient) Commit ¶
func (m *MockBaseClient) Commit(height *int64) (*core_types.ResultCommit, error)
Commit mocks base method
func (*MockBaseClient) EXPECT ¶
func (m *MockBaseClient) EXPECT() *MockBaseClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockBaseClient) GetCodec ¶
func (m *MockBaseClient) GetCodec() SDKCodec
GetCodec mocks base method
func (*MockBaseClient) GetConfig ¶
func (m *MockBaseClient) GetConfig() ClientConfig
GetConfig mocks base method
func (*MockBaseClient) QueryStore ¶
QueryStore mocks base method
func (*MockBaseClient) QuerySubspace ¶
QuerySubspace mocks base method
func (*MockBaseClient) Tx ¶
func (m *MockBaseClient) Tx(hash []byte, prove bool) (*core_types.ResultTx, error)
Tx mocks base method
func (*MockBaseClient) TxSearch ¶
func (m *MockBaseClient) TxSearch(query string, prove bool, page, perPage int) (*core_types.ResultTxSearch, error)
TxSearch mocks base method
func (*MockBaseClient) Validators ¶
func (m *MockBaseClient) Validators(height *int64) (*core_types.ResultValidators, error)
Validators mocks base method
type MockBaseClientMockRecorder ¶
type MockBaseClientMockRecorder struct {
// contains filtered or unexported fields
}
MockBaseClientMockRecorder is the mock recorder for MockBaseClient
func (*MockBaseClientMockRecorder) Block ¶
func (mr *MockBaseClientMockRecorder) Block(height interface{}) *gomock.Call
Block indicates an expected call of Block
func (*MockBaseClientMockRecorder) BlockResults ¶
func (mr *MockBaseClientMockRecorder) BlockResults(height interface{}) *gomock.Call
BlockResults indicates an expected call of BlockResults
func (*MockBaseClientMockRecorder) Broadcast ¶
func (mr *MockBaseClientMockRecorder) Broadcast(txBytes, broadcastMode interface{}) *gomock.Call
Broadcast indicates an expected call of Broadcast
func (*MockBaseClientMockRecorder) BuildAndBroadcast ¶
func (mr *MockBaseClientMockRecorder) BuildAndBroadcast(fromName, passphrase, memo, msgs, accNumber, seqNumber interface{}) *gomock.Call
BuildAndBroadcast indicates an expected call of BuildAndBroadcast
func (*MockBaseClientMockRecorder) BuildStdTx ¶
func (mr *MockBaseClientMockRecorder) BuildStdTx(fromName, passphrase, memo, msgs, accNumber, seqNumber interface{}) *gomock.Call
BuildStdTx indicates an expected call of BuildStdTx
func (*MockBaseClientMockRecorder) BuildTxForSim ¶
func (mr *MockBaseClientMockRecorder) BuildTxForSim(msgs, memo, accNumber, seqNumber interface{}) *gomock.Call
BuildTxForSim indicates an expected call of BuildTxForSim
func (*MockBaseClientMockRecorder) BuildUnsignedStdTxOffline ¶
func (mr *MockBaseClientMockRecorder) BuildUnsignedStdTxOffline(msgs, memo interface{}) *gomock.Call
BuildUnsignedStdTxOffline indicates an expected call of BuildUnsignedStdTxOffline
func (*MockBaseClientMockRecorder) CalculateGas ¶
func (mr *MockBaseClientMockRecorder) CalculateGas(txBytes interface{}) *gomock.Call
CalculateGas indicates an expected call of CalculateGas
func (*MockBaseClientMockRecorder) Commit ¶
func (mr *MockBaseClientMockRecorder) Commit(height interface{}) *gomock.Call
Commit indicates an expected call of Commit
func (*MockBaseClientMockRecorder) GetCodec ¶
func (mr *MockBaseClientMockRecorder) GetCodec() *gomock.Call
GetCodec indicates an expected call of GetCodec
func (*MockBaseClientMockRecorder) GetConfig ¶
func (mr *MockBaseClientMockRecorder) GetConfig() *gomock.Call
GetConfig indicates an expected call of GetConfig
func (*MockBaseClientMockRecorder) Query ¶
func (mr *MockBaseClientMockRecorder) Query(path, key interface{}) *gomock.Call
Query indicates an expected call of Query
func (*MockBaseClientMockRecorder) QueryStore ¶
func (mr *MockBaseClientMockRecorder) QueryStore(key, storeName, endPath interface{}) *gomock.Call
QueryStore indicates an expected call of QueryStore
func (*MockBaseClientMockRecorder) QuerySubspace ¶
func (mr *MockBaseClientMockRecorder) QuerySubspace(subspace, storeName interface{}) *gomock.Call
QuerySubspace indicates an expected call of QuerySubspace
func (*MockBaseClientMockRecorder) Tx ¶
func (mr *MockBaseClientMockRecorder) Tx(hash, prove interface{}) *gomock.Call
Tx indicates an expected call of Tx
func (*MockBaseClientMockRecorder) TxSearch ¶
func (mr *MockBaseClientMockRecorder) TxSearch(query, prove, page, perPage interface{}) *gomock.Call
TxSearch indicates an expected call of TxSearch
func (*MockBaseClientMockRecorder) Validators ¶
func (mr *MockBaseClientMockRecorder) Validators(height interface{}) *gomock.Call
Validators indicates an expected call of Validators
type MockClientQuery ¶
type MockClientQuery struct {
// contains filtered or unexported fields
}
MockClientQuery is a mock of ClientQuery interface
func NewMockClientQuery ¶
func NewMockClientQuery(ctrl *gomock.Controller) *MockClientQuery
NewMockClientQuery creates a new mock instance
func (*MockClientQuery) Block ¶
func (m *MockClientQuery) Block(height *int64) (*core_types.ResultBlock, error)
Block mocks base method
func (*MockClientQuery) BlockResults ¶
func (m *MockClientQuery) BlockResults(height *int64) (*core_types.ResultBlockResults, error)
BlockResults mocks base method
func (*MockClientQuery) Commit ¶
func (m *MockClientQuery) Commit(height *int64) (*core_types.ResultCommit, error)
Commit mocks base method
func (*MockClientQuery) EXPECT ¶
func (m *MockClientQuery) EXPECT() *MockClientQueryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockClientQuery) QueryStore ¶
func (m *MockClientQuery) QueryStore(key common.HexBytes, storeName, endPath string) ([]byte, error)
QueryStore mocks base method
func (*MockClientQuery) QuerySubspace ¶
QuerySubspace mocks base method
func (*MockClientQuery) Tx ¶
func (m *MockClientQuery) Tx(hash []byte, prove bool) (*core_types.ResultTx, error)
Tx mocks base method
func (*MockClientQuery) TxSearch ¶
func (m *MockClientQuery) TxSearch(query string, prove bool, page, perPage int) (*core_types.ResultTxSearch, error)
TxSearch mocks base method
func (*MockClientQuery) Validators ¶
func (m *MockClientQuery) Validators(height *int64) (*core_types.ResultValidators, error)
Validators mocks base method
type MockClientQueryMockRecorder ¶
type MockClientQueryMockRecorder struct {
// contains filtered or unexported fields
}
MockClientQueryMockRecorder is the mock recorder for MockClientQuery
func (*MockClientQueryMockRecorder) Block ¶
func (mr *MockClientQueryMockRecorder) Block(height interface{}) *gomock.Call
Block indicates an expected call of Block
func (*MockClientQueryMockRecorder) BlockResults ¶
func (mr *MockClientQueryMockRecorder) BlockResults(height interface{}) *gomock.Call
BlockResults indicates an expected call of BlockResults
func (*MockClientQueryMockRecorder) Commit ¶
func (mr *MockClientQueryMockRecorder) Commit(height interface{}) *gomock.Call
Commit indicates an expected call of Commit
func (*MockClientQueryMockRecorder) Query ¶
func (mr *MockClientQueryMockRecorder) Query(path, key interface{}) *gomock.Call
Query indicates an expected call of Query
func (*MockClientQueryMockRecorder) QueryStore ¶
func (mr *MockClientQueryMockRecorder) QueryStore(key, storeName, endPath interface{}) *gomock.Call
QueryStore indicates an expected call of QueryStore
func (*MockClientQueryMockRecorder) QuerySubspace ¶
func (mr *MockClientQueryMockRecorder) QuerySubspace(subspace, storeName interface{}) *gomock.Call
QuerySubspace indicates an expected call of QuerySubspace
func (*MockClientQueryMockRecorder) Tx ¶
func (mr *MockClientQueryMockRecorder) Tx(hash, prove interface{}) *gomock.Call
Tx indicates an expected call of Tx
func (*MockClientQueryMockRecorder) TxSearch ¶
func (mr *MockClientQueryMockRecorder) TxSearch(query, prove, page, perPage interface{}) *gomock.Call
TxSearch indicates an expected call of TxSearch
func (*MockClientQueryMockRecorder) Validators ¶
func (mr *MockClientQueryMockRecorder) Validators(height interface{}) *gomock.Call
Validators indicates an expected call of Validators
type MockClientTx ¶
type MockClientTx struct {
// contains filtered or unexported fields
}
MockClientTx is a mock of ClientTx interface
func NewMockClientTx ¶
func NewMockClientTx(ctrl *gomock.Controller) *MockClientTx
NewMockClientTx creates a new mock instance
func (*MockClientTx) Broadcast ¶
func (m *MockClientTx) Broadcast(txBytes []byte, broadcastMode BroadcastMode) (TxResponse, error)
Broadcast mocks base method
func (*MockClientTx) EXPECT ¶
func (m *MockClientTx) EXPECT() *MockClientTxMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockClientTxMockRecorder ¶
type MockClientTxMockRecorder struct {
// contains filtered or unexported fields
}
MockClientTxMockRecorder is the mock recorder for MockClientTx
func (*MockClientTxMockRecorder) Broadcast ¶
func (mr *MockClientTxMockRecorder) Broadcast(txBytes, broadcastMode interface{}) *gomock.Call
Broadcast indicates an expected call of Broadcast
type MockRPCClient ¶
type MockRPCClient struct {
// contains filtered or unexported fields
}
MockRPCClient is a mock of RPCClient interface
func NewMockRPCClient ¶
func NewMockRPCClient(ctrl *gomock.Controller) *MockRPCClient
NewMockRPCClient creates a new mock instance
func (*MockRPCClient) ABCIInfo ¶
func (m *MockRPCClient) ABCIInfo() (*core_types.ResultABCIInfo, error)
ABCIInfo mocks base method
func (*MockRPCClient) ABCIQuery ¶
func (m *MockRPCClient) ABCIQuery(path string, data common.HexBytes) (*core_types.ResultABCIQuery, error)
ABCIQuery mocks base method
func (*MockRPCClient) ABCIQueryWithOptions ¶
func (m *MockRPCClient) ABCIQueryWithOptions(path string, data common.HexBytes, opts client.ABCIQueryOptions) (*core_types.ResultABCIQuery, error)
ABCIQueryWithOptions mocks base method
func (*MockRPCClient) Block ¶
func (m *MockRPCClient) Block(height *int64) (*core_types.ResultBlock, error)
Block mocks base method
func (*MockRPCClient) BlockResults ¶
func (m *MockRPCClient) BlockResults(height *int64) (*core_types.ResultBlockResults, error)
BlockResults mocks base method
func (*MockRPCClient) BroadcastTxAsync ¶
func (m *MockRPCClient) BroadcastTxAsync(tx types.Tx) (*core_types.ResultBroadcastTx, error)
BroadcastTxAsync mocks base method
func (*MockRPCClient) BroadcastTxCommit ¶
func (m *MockRPCClient) BroadcastTxCommit(tx types.Tx) (*core_types.ResultBroadcastTxCommit, error)
BroadcastTxCommit mocks base method
func (*MockRPCClient) BroadcastTxSync ¶
func (m *MockRPCClient) BroadcastTxSync(tx types.Tx) (*core_types.ResultBroadcastTx, error)
BroadcastTxSync mocks base method
func (*MockRPCClient) Commit ¶
func (m *MockRPCClient) Commit(height *int64) (*core_types.ResultCommit, error)
Commit mocks base method
func (*MockRPCClient) EXPECT ¶
func (m *MockRPCClient) EXPECT() *MockRPCClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockRPCClient) Tx ¶
func (m *MockRPCClient) Tx(hash []byte, prove bool) (*core_types.ResultTx, error)
Tx mocks base method
func (*MockRPCClient) TxSearch ¶
func (m *MockRPCClient) TxSearch(query string, prove bool, page, perPage int) (*core_types.ResultTxSearch, error)
TxSearch mocks base method
func (*MockRPCClient) Validators ¶
func (m *MockRPCClient) Validators(height *int64) (*core_types.ResultValidators, error)
Validators mocks base method
type MockRPCClientMockRecorder ¶
type MockRPCClientMockRecorder struct {
// contains filtered or unexported fields
}
MockRPCClientMockRecorder is the mock recorder for MockRPCClient
func (*MockRPCClientMockRecorder) ABCIInfo ¶
func (mr *MockRPCClientMockRecorder) ABCIInfo() *gomock.Call
ABCIInfo indicates an expected call of ABCIInfo
func (*MockRPCClientMockRecorder) ABCIQuery ¶
func (mr *MockRPCClientMockRecorder) ABCIQuery(path, data interface{}) *gomock.Call
ABCIQuery indicates an expected call of ABCIQuery
func (*MockRPCClientMockRecorder) ABCIQueryWithOptions ¶
func (mr *MockRPCClientMockRecorder) ABCIQueryWithOptions(path, data, opts interface{}) *gomock.Call
ABCIQueryWithOptions indicates an expected call of ABCIQueryWithOptions
func (*MockRPCClientMockRecorder) Block ¶
func (mr *MockRPCClientMockRecorder) Block(height interface{}) *gomock.Call
Block indicates an expected call of Block
func (*MockRPCClientMockRecorder) BlockResults ¶
func (mr *MockRPCClientMockRecorder) BlockResults(height interface{}) *gomock.Call
BlockResults indicates an expected call of BlockResults
func (*MockRPCClientMockRecorder) BroadcastTxAsync ¶
func (mr *MockRPCClientMockRecorder) BroadcastTxAsync(tx interface{}) *gomock.Call
BroadcastTxAsync indicates an expected call of BroadcastTxAsync
func (*MockRPCClientMockRecorder) BroadcastTxCommit ¶
func (mr *MockRPCClientMockRecorder) BroadcastTxCommit(tx interface{}) *gomock.Call
BroadcastTxCommit indicates an expected call of BroadcastTxCommit
func (*MockRPCClientMockRecorder) BroadcastTxSync ¶
func (mr *MockRPCClientMockRecorder) BroadcastTxSync(tx interface{}) *gomock.Call
BroadcastTxSync indicates an expected call of BroadcastTxSync
func (*MockRPCClientMockRecorder) Commit ¶
func (mr *MockRPCClientMockRecorder) Commit(height interface{}) *gomock.Call
Commit indicates an expected call of Commit
func (*MockRPCClientMockRecorder) Tx ¶
func (mr *MockRPCClientMockRecorder) Tx(hash, prove interface{}) *gomock.Call
Tx indicates an expected call of Tx
func (*MockRPCClientMockRecorder) TxSearch ¶
func (mr *MockRPCClientMockRecorder) TxSearch(query, prove, page, perPage interface{}) *gomock.Call
TxSearch indicates an expected call of TxSearch
func (*MockRPCClientMockRecorder) Validators ¶
func (mr *MockRPCClientMockRecorder) Validators(height interface{}) *gomock.Call
Validators indicates an expected call of Validators
type MockSimulationHandler ¶
type MockSimulationHandler struct {
// contains filtered or unexported fields
}
MockSimulationHandler is a mock of SimulationHandler interface
func NewMockSimulationHandler ¶
func NewMockSimulationHandler(ctrl *gomock.Controller) *MockSimulationHandler
NewMockSimulationHandler creates a new mock instance
func (*MockSimulationHandler) BuildTxForSim ¶
func (m *MockSimulationHandler) BuildTxForSim(msgs []Msg, memo string, accNumber, seqNumber uint64) ([]byte, error)
BuildTxForSim mocks base method
func (*MockSimulationHandler) CalculateGas ¶
func (m *MockSimulationHandler) CalculateGas(txBytes []byte) (StdFee, error)
CalculateGas mocks base method
func (*MockSimulationHandler) EXPECT ¶
func (m *MockSimulationHandler) EXPECT() *MockSimulationHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockSimulationHandlerMockRecorder ¶
type MockSimulationHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockSimulationHandlerMockRecorder is the mock recorder for MockSimulationHandler
func (*MockSimulationHandlerMockRecorder) BuildTxForSim ¶
func (mr *MockSimulationHandlerMockRecorder) BuildTxForSim(msgs, memo, accNumber, seqNumber interface{}) *gomock.Call
BuildTxForSim indicates an expected call of BuildTxForSim
func (*MockSimulationHandlerMockRecorder) CalculateGas ¶
func (mr *MockSimulationHandlerMockRecorder) CalculateGas(txBytes interface{}) *gomock.Call
CalculateGas indicates an expected call of CalculateGas
type MockTxHandler ¶
type MockTxHandler struct {
// contains filtered or unexported fields
}
MockTxHandler is a mock of TxHandler interface
func NewMockTxHandler ¶
func NewMockTxHandler(ctrl *gomock.Controller) *MockTxHandler
NewMockTxHandler creates a new mock instance
func (*MockTxHandler) BuildAndBroadcast ¶
func (m *MockTxHandler) BuildAndBroadcast(fromName, passphrase, memo string, msgs []Msg, accNumber, seqNumber uint64) (TxResponse, error)
BuildAndBroadcast mocks base method
func (*MockTxHandler) BuildStdTx ¶
func (m *MockTxHandler) BuildStdTx(fromName, passphrase, memo string, msgs []Msg, accNumber, seqNumber uint64) (StdTx, error)
BuildStdTx mocks base method
func (*MockTxHandler) BuildUnsignedStdTxOffline ¶
func (m *MockTxHandler) BuildUnsignedStdTxOffline(msgs []Msg, memo string) StdTx
BuildUnsignedStdTxOffline mocks base method
func (*MockTxHandler) EXPECT ¶
func (m *MockTxHandler) EXPECT() *MockTxHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockTxHandlerMockRecorder ¶
type MockTxHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockTxHandlerMockRecorder is the mock recorder for MockTxHandler
func (*MockTxHandlerMockRecorder) BuildAndBroadcast ¶
func (mr *MockTxHandlerMockRecorder) BuildAndBroadcast(fromName, passphrase, memo, msgs, accNumber, seqNumber interface{}) *gomock.Call
BuildAndBroadcast indicates an expected call of BuildAndBroadcast
func (*MockTxHandlerMockRecorder) BuildStdTx ¶
func (mr *MockTxHandlerMockRecorder) BuildStdTx(fromName, passphrase, memo, msgs, accNumber, seqNumber interface{}) *gomock.Call
BuildStdTx indicates an expected call of BuildStdTx
func (*MockTxHandlerMockRecorder) BuildUnsignedStdTxOffline ¶
func (mr *MockTxHandlerMockRecorder) BuildUnsignedStdTxOffline(msgs, memo interface{}) *gomock.Call
BuildUnsignedStdTxOffline indicates an expected call of BuildUnsignedStdTxOffline
type Msg ¶
type Msg interface { Route() string Type() string ValidateBasic() Error GetSignBytes() []byte GetSigners() []AccAddress }
Msg shows the expected behavior of any msgs of OKChain
type RPCClient ¶
type RPCClient interface { rpc.ABCIClient rpc.SignClient }
RPCClient shows the expected behavior for a inner exposed client
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 SDKCodec ¶
type SDKCodec interface { MarshalJSON(o interface{}) ([]byte, error) UnmarshalJSON(bytes []byte, ptr interface{}) error MustMarshalJSON(o interface{}) []byte MustUnmarshalJSON(bytes []byte, ptr interface{}) MarshalBinaryLengthPrefixed(o interface{}) ([]byte, error) UnmarshalBinaryLengthPrefixed(bytes []byte, ptr interface{}) error MustMarshalBinaryLengthPrefixed(o interface{}) []byte MustUnmarshalBinaryLengthPrefixed(bytes []byte, ptr interface{}) MarshalBinaryBare(o interface{}) ([]byte, error) UnmarshalBinaryBare(bytes []byte, ptr interface{}) error RegisterConcrete(o interface{}, name string) RegisterInterface(ptr interface{}) Seal() }
SDKCodec shows the expected behaviour of codec in okchain gosdk
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
type SimulationHandler ¶
type SimulationHandler interface { CalculateGas(txBytes []byte) (StdFee, error) BuildTxForSim(msgs []Msg, memo string, accNumber, seqNumber uint64) ([]byte, error) }
SimulationHandler shows the expected behavior to handle simulation
type StdFee ¶
StdFee includes the amount of coins paid in fees and the maximum gas to be used by the transaction
type StdSignDoc ¶
type StdSignDoc struct { AccountNumber uint64 `json:"account_number"` ChainID string `json:"chain_id"` Fee json.RawMessage `json:"fee"` Memo string `json:"memo"` Msgs []json.RawMessage `json:"msgs"` Sequence uint64 `json:"sequence"` }
StdSignDoc is replay-prevention structure It includes the result of msg.GetSignBytes(), as well as the ChainID (prevent cross chain replay) and the Sequence numbers for each signature (prevent inchain replay and enforce tx ordering per account)
type StdSignMsg ¶
type StdSignMsg struct { ChainID string `json:"chain_id"` AccountNumber uint64 `json:"account_number"` Sequence uint64 `json:"sequence"` Fee StdFee `json:"fee"` Msgs []Msg `json:"msgs"` Memo string `json:"memo"` }
StdSignMsg is a convenience structure for passing along a Msg with the other requirements for a StdSignDoc before it is signed
type StdSignature ¶
StdSignature is the struct of signature in stdTx
func NewStdSignature ¶
func NewStdSignature(pubkey crypto.PubKey, signature []byte) StdSignature
NewStdSignature creates a new instance of std signature
type StdTx ¶
type StdTx struct { Msgs []Msg `json:"msg"` Fee StdFee `json:"fee"` Signatures []StdSignature `json:"signatures"` Memo string `json:"memo"` }
StdTx is a standard way to wrap a Msg with Fee and Signatures
func NewStdTx ¶
func NewStdTx(msgs []Msg, fee StdFee, sigs []StdSignature, memo string) StdTx
NewStdTx creates a new instance of StdTx
func (StdTx) ValidateBasic ¶
type StringEvent ¶
type StringEvent struct { Type string `json:"type,omitempty"` Attributes []Attribute `json:"attributes,omitempty"` }
StringEvent 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 abci.Event) StringEvent
StringifyEvent converts an Event object to a StringEvent object
type StringEvents ¶
type StringEvents []StringEvent
StringEvents defines a slice of StringEvents objects
func StringifyEvents ¶
func StringifyEvents(events []abci.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) String ¶
func (se StringEvents) String() string
String returns a human readable string representation of StringEvents
type TxHandler ¶
type TxHandler interface { BuildAndBroadcast(fromName, passphrase, memo string, msgs []Msg, accNumber, seqNumber uint64) (TxResponse, error) BuildStdTx(fromName, passphrase, memo string, msgs []Msg, accNumber, seqNumber uint64) (StdTx, error) BuildUnsignedStdTxOffline(msgs []Msg, memo string) StdTx }
TxHandler shows the expected behavior to handle tx
type TxResponse ¶
type TxResponse struct { Height int64 `json:"height,omitempty"` 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:"-"` GasUsed int64 `json:"-"` Codespace string `json:"codespace,omitempty"` Tx Tx `json:"tx,omitempty"` Timestamp string `json:"timestamp,omitempty"` // DEPRECATED: Remove in the next next major release in favor of using the ABCIMessageLog.Events field Events StringEvents `json:"events,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 (TxResponse) Empty ¶
func (r TxResponse) Empty() bool
Empty returns true if the response is empty
func (TxResponse) String ¶
func (r TxResponse) String() string
String returns a human readable string representation of TxResponse
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 (ValAddress) Empty ¶
func (va ValAddress) Empty() bool
Empty returns boolean for whether an ValAddress is empty
func (ValAddress) Equals ¶
func (va ValAddress) Equals(va2 Address) bool
Equals 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
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) 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