cosmos-sdk: github.com/cosmos/cosmos-sdk/x/auth/types Index | Files

package types

import "github.com/cosmos/cosmos-sdk/x/auth/types"

nolint noalias

Index

Package Files

account.go account_retriever.go codec.go errors.go expected_keepers.go genesis.go keys.go params.go querier.go stdsignmsg.go stdtx.go test_utils.go txbuilder.go types.pb.go

Constants

const (
    // module name
    ModuleName = "auth"

    // StoreKey is string representation of the store key for auth
    StoreKey = "acc"

    // FeeCollectorName the root string for the fee collector account address
    FeeCollectorName = "fee_collector"

    // QuerierRoute is the querier route for auth
    QuerierRoute = ModuleName
)
const (
    DefaultMaxMemoCharacters      uint64 = 256
    DefaultTxSigLimit             uint64 = 7
    DefaultTxSizeCostPerByte      uint64 = 10
    DefaultSigVerifyCostED25519   uint64 = 590
    DefaultSigVerifyCostSecp256k1 uint64 = 1000
)

Default parameter values

const (
    QueryAccount = "account"
    QueryParams  = "params"
)

query endpoints supported by the auth Querier

const DefaultParamspace = ModuleName

DefaultParamspace defines the default auth module parameter subspace

Variables

var (
    ErrorInvalidSigner        = sdkerrors.Register(ModuleName, 2, "tx intended signer does not match the given signer")
    ErrorInvalidGasAdjustment = sdkerrors.Register(ModuleName, 3, "invalid gas adjustment")
)
var (
    // AddressStoreKeyPrefix prefix for account-by-address store
    AddressStoreKeyPrefix = []byte{0x01}

    // param key for global account number
    GlobalAccountNumberKey = []byte("globalAccountNumber")
)
var (
    KeyMaxMemoCharacters      = []byte("MaxMemoCharacters")
    KeyTxSigLimit             = []byte("TxSigLimit")
    KeyTxSizeCostPerByte      = []byte("TxSizeCostPerByte")
    KeySigVerifyCostED25519   = []byte("SigVerifyCostED25519")
    KeySigVerifyCostSecp256k1 = []byte("SigVerifyCostSecp256k1")
)

Parameter keys

var (
    ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
var (

    // ModuleCdc references the global x/auth module codec. Note, the codec should
    // ONLY be used in certain instances of tests and for JSON encoding as Amino is
    // still used for that purpose.
    //
    // The actual codec used for serialization should be provided to x/auth and
    // defined at the application level.
    ModuleCdc = codec.NewHybridCodec(amino)
)

func AddressStoreKey Uses

func AddressStoreKey(addr sdk.AccAddress) []byte

AddressStoreKey turn an address to key used to get it from the account store

func CountSubKeys Uses

func CountSubKeys(pub crypto.PubKey) int

CountSubKeys counts the total number of keys for a multi-sig public key.

func DefaultTxDecoder Uses

func DefaultTxDecoder(cdc *codec.Codec) sdk.TxDecoder

DefaultTxDecoder logic for standard transaction decoding

func DefaultTxEncoder Uses

func DefaultTxEncoder(cdc *codec.Codec) sdk.TxEncoder

DefaultTxEncoder logic for standard transaction encoding

func KeyTestPubAddr Uses

func KeyTestPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress)

func NewTestCoins Uses

func NewTestCoins() sdk.Coins

coins to more than cover the fee

func NewTestMsg Uses

func NewTestMsg(addrs ...sdk.AccAddress) *sdk.TestMsg

func NewTestTx Uses

func NewTestTx(ctx sdk.Context, msgs []sdk.Msg, privs []crypto.PrivKey, accNums []uint64, seqs []uint64, fee StdFee) sdk.Tx

func NewTestTxWithMemo Uses

func NewTestTxWithMemo(ctx sdk.Context, msgs []sdk.Msg, privs []crypto.PrivKey, accNums []uint64, seqs []uint64, fee StdFee, memo string) sdk.Tx

func NewTestTxWithSignBytes Uses

func NewTestTxWithSignBytes(msgs []sdk.Msg, privs []crypto.PrivKey, accNums []uint64, seqs []uint64, fee StdFee, signBytes []byte, memo string) sdk.Tx

func ParamKeyTable Uses

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable for auth module

func ProtoBaseAccount Uses

func ProtoBaseAccount() exported.Account

ProtoBaseAccount - a prototype function for BaseAccount

func RegisterCodec Uses

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the account interfaces and concrete types on the provided Amino codec.

func SanitizeGenesisAccounts Uses

func SanitizeGenesisAccounts(genAccs exported.GenesisAccounts) exported.GenesisAccounts

SanitizeGenesisAccounts sorts accounts and coin sets.

func StdSignBytes Uses

func StdSignBytes(chainID string, accnum uint64, sequence uint64, fee StdFee, msgs []sdk.Msg, memo string) []byte

StdSignBytes returns the bytes to sign for a transaction.

func ValidateGenAccounts Uses

func ValidateGenAccounts(accounts exported.GenesisAccounts) error

ValidateGenAccounts validates an array of GenesisAccounts and checks for duplicates

func ValidateGenesis Uses

func ValidateGenesis(data GenesisState) error

ValidateGenesis performs basic validation of auth genesis data returning an error for any failed validation criteria.

type AccountRetriever Uses

type AccountRetriever struct {
    // contains filtered or unexported fields
}

AccountRetriever defines the properties of a type that can be used to retrieve accounts.

func NewAccountRetriever Uses

func NewAccountRetriever(codec Codec, querier NodeQuerier) AccountRetriever

NewAccountRetriever initialises a new AccountRetriever instance.

func (AccountRetriever) EnsureExists Uses

func (ar AccountRetriever) EnsureExists(addr sdk.AccAddress) error

EnsureExists returns an error if no account exists for the given address else nil.

func (AccountRetriever) GetAccount Uses

func (ar AccountRetriever) GetAccount(addr sdk.AccAddress) (exported.Account, error)

GetAccount queries for an account given an address and a block height. An error is returned if the query or decoding fails.

func (AccountRetriever) GetAccountNumberSequence Uses

func (ar AccountRetriever) GetAccountNumberSequence(addr sdk.AccAddress) (uint64, uint64, error)

GetAccountNumberSequence returns sequence and account number for the given address. It returns an error if the account couldn't be retrieved from the state.

func (AccountRetriever) GetAccountWithHeight Uses

func (ar AccountRetriever) GetAccountWithHeight(addr sdk.AccAddress) (exported.Account, int64, error)

GetAccountWithHeight queries for an account given an address. Returns the height of the query with the account. An error is returned if the query or decoding fails.

type BaseAccount Uses

type BaseAccount struct {
    Address       github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
    PubKey        []byte                                        `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty" yaml:"public_key"`
    AccountNumber uint64                                        `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty" yaml:"account_number"`
    Sequence      uint64                                        `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"`
}

BaseAccount defines a base account type. It contains all the necessary fields for basic account functionality. Any custom account type should extend this type for additional functionality (e.g. vesting).

func NewBaseAccount Uses

func NewBaseAccount(address sdk.AccAddress, pubKey crypto.PubKey, accountNumber, sequence uint64) *BaseAccount

NewBaseAccount creates a new BaseAccount object

func NewBaseAccountWithAddress Uses

func NewBaseAccountWithAddress(addr sdk.AccAddress) *BaseAccount

NewBaseAccountWithAddress - returns a new base account with a given address

func (*BaseAccount) Descriptor Uses

func (*BaseAccount) Descriptor() ([]byte, []int)

func (BaseAccount) GetAccountNumber Uses

func (acc BaseAccount) GetAccountNumber() uint64

GetAccountNumber - Implements Account

func (BaseAccount) GetAddress Uses

func (acc BaseAccount) GetAddress() sdk.AccAddress

GetAddress - Implements sdk.Account.

func (BaseAccount) GetPubKey Uses

func (acc BaseAccount) GetPubKey() (pk crypto.PubKey)

GetPubKey - Implements sdk.Account.

func (BaseAccount) GetSequence Uses

func (acc BaseAccount) GetSequence() uint64

GetSequence - Implements sdk.Account.

func (*BaseAccount) Marshal Uses

func (m *BaseAccount) Marshal() (dAtA []byte, err error)

func (BaseAccount) MarshalJSON Uses

func (acc BaseAccount) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of a BaseAccount.

func (*BaseAccount) MarshalTo Uses

func (m *BaseAccount) MarshalTo(dAtA []byte) (int, error)

func (*BaseAccount) MarshalToSizedBuffer Uses

func (m *BaseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (BaseAccount) MarshalYAML Uses

func (acc BaseAccount) MarshalYAML() (interface{}, error)

MarshalYAML returns the YAML representation of an account.

func (*BaseAccount) ProtoMessage Uses

func (*BaseAccount) ProtoMessage()

func (*BaseAccount) Reset Uses

func (m *BaseAccount) Reset()

func (*BaseAccount) SetAccountNumber Uses

func (acc *BaseAccount) SetAccountNumber(accNumber uint64) error

SetAccountNumber - Implements Account

func (*BaseAccount) SetAddress Uses

func (acc *BaseAccount) SetAddress(addr sdk.AccAddress) error

SetAddress - Implements sdk.Account.

func (*BaseAccount) SetPubKey Uses

func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error

SetPubKey - Implements sdk.Account.

func (*BaseAccount) SetSequence Uses

func (acc *BaseAccount) SetSequence(seq uint64) error

SetSequence - Implements sdk.Account.

func (*BaseAccount) Size Uses

func (m *BaseAccount) Size() (n int)

func (BaseAccount) String Uses

func (acc BaseAccount) String() string

func (*BaseAccount) Unmarshal Uses

func (m *BaseAccount) Unmarshal(dAtA []byte) error

func (*BaseAccount) UnmarshalJSON Uses

func (acc *BaseAccount) UnmarshalJSON(bz []byte) error

UnmarshalJSON unmarshals raw JSON bytes into a BaseAccount.

func (BaseAccount) Validate Uses

func (acc BaseAccount) Validate() error

Validate checks for errors on the account fields

func (*BaseAccount) XXX_DiscardUnknown Uses

func (m *BaseAccount) XXX_DiscardUnknown()

func (*BaseAccount) XXX_Marshal Uses

func (m *BaseAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BaseAccount) XXX_Merge Uses

func (m *BaseAccount) XXX_Merge(src proto.Message)

func (*BaseAccount) XXX_Size Uses

func (m *BaseAccount) XXX_Size() int

func (*BaseAccount) XXX_Unmarshal Uses

func (m *BaseAccount) XXX_Unmarshal(b []byte) error

type Codec Uses

type Codec interface {
    codec.Marshaler

    MarshalAccount(acc exported.Account) ([]byte, error)
    UnmarshalAccount(bz []byte) (exported.Account, error)

    MarshalAccountJSON(acc exported.Account) ([]byte, error)
    UnmarshalAccountJSON(bz []byte) (exported.Account, error)
}

Codec defines the interface needed to serialize x/auth state. It must be aware of all concrete account types.

type GenesisAccountIterator Uses

type GenesisAccountIterator struct{}

GenesisAccountIterator implements genesis account iteration.

func (GenesisAccountIterator) IterateGenesisAccounts Uses

func (GenesisAccountIterator) IterateGenesisAccounts(
    cdc Codec, appGenesis map[string]json.RawMessage, cb func(exported.Account) (stop bool),
)

IterateGenesisAccounts iterates over all the genesis accounts found in appGenesis and invokes a callback on each genesis account. If any call returns true, iteration stops.

type GenesisState Uses

type GenesisState struct {
    Params   Params                   `json:"params" yaml:"params"`
    Accounts exported.GenesisAccounts `json:"accounts" yaml:"accounts"`
}

GenesisState - all auth state that must be provided at genesis

func DefaultGenesisState Uses

func DefaultGenesisState() GenesisState

DefaultGenesisState - Return a default genesis state

func GetGenesisStateFromAppState Uses

func GetGenesisStateFromAppState(cdc Codec, appState map[string]json.RawMessage) GenesisState

GetGenesisStateFromAppState returns x/auth GenesisState given raw application genesis state.

func NewGenesisState Uses

func NewGenesisState(params Params, accounts exported.GenesisAccounts) GenesisState

NewGenesisState - Create a new genesis state

type NodeQuerier Uses

type NodeQuerier interface {
    // QueryWithData performs a query to a Tendermint node with the provided path
    // and a data payload. It returns the result and height of the query upon success
    // or an error if the query fails.
    QueryWithData(path string, data []byte) ([]byte, int64, error)
}

NodeQuerier is an interface that is satisfied by types that provide the QueryWithData method

type Params Uses

type Params struct {
    MaxMemoCharacters      uint64 `protobuf:"varint,1,opt,name=max_memo_characters,json=maxMemoCharacters,proto3" json:"max_memo_characters,omitempty" yaml:"max_memo_characters"`
    TxSigLimit             uint64 `protobuf:"varint,2,opt,name=tx_sig_limit,json=txSigLimit,proto3" json:"tx_sig_limit,omitempty" yaml:"tx_sig_limit"`
    TxSizeCostPerByte      uint64 `protobuf:"varint,3,opt,name=tx_size_cost_per_byte,json=txSizeCostPerByte,proto3" json:"tx_size_cost_per_byte,omitempty" yaml:"tx_size_cost_per_byte"`
    SigVerifyCostED25519   uint64 `protobuf:"varint,4,opt,name=sig_verify_cost_ed25519,json=sigVerifyCostEd25519,proto3" json:"sig_verify_cost_ed25519,omitempty" yaml:"sig_verify_cost_ed25519"`
    SigVerifyCostSecp256k1 uint64 `protobuf:"varint,5,opt,name=sig_verify_cost_secp256k1,json=sigVerifyCostSecp256k1,proto3" json:"sig_verify_cost_secp256k1,omitempty" yaml:"sig_verify_cost_secp256k1"`
}

Params defines the parameters for the auth module.

func DefaultParams Uses

func DefaultParams() Params

DefaultParams returns a default set of parameters.

func NewParams Uses

func NewParams(
    maxMemoCharacters, txSigLimit, txSizeCostPerByte, sigVerifyCostED25519, sigVerifyCostSecp256k1 uint64,
) Params

NewParams creates a new Params object

func (*Params) Descriptor Uses

func (*Params) Descriptor() ([]byte, []int)

func (*Params) Equal Uses

func (this *Params) Equal(that interface{}) bool

func (*Params) GetMaxMemoCharacters Uses

func (m *Params) GetMaxMemoCharacters() uint64

func (*Params) GetSigVerifyCostED25519 Uses

func (m *Params) GetSigVerifyCostED25519() uint64

func (*Params) GetSigVerifyCostSecp256k1 Uses

func (m *Params) GetSigVerifyCostSecp256k1() uint64

func (*Params) GetTxSigLimit Uses

func (m *Params) GetTxSigLimit() uint64

func (*Params) GetTxSizeCostPerByte Uses

func (m *Params) GetTxSizeCostPerByte() uint64

func (*Params) Marshal Uses

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo Uses

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer Uses

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs Uses

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of auth module's parameters. nolint

func (*Params) ProtoMessage Uses

func (*Params) ProtoMessage()

func (*Params) Reset Uses

func (m *Params) Reset()

func (*Params) Size Uses

func (m *Params) Size() (n int)

func (Params) String Uses

func (p Params) String() string

String implements the stringer interface.

func (*Params) Unmarshal Uses

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) Validate Uses

func (p Params) Validate() error

Validate checks that the parameters have valid values.

func (*Params) XXX_DiscardUnknown Uses

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal Uses

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge Uses

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size Uses

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal Uses

func (m *Params) XXX_Unmarshal(b []byte) error

type QueryAccountParams Uses

type QueryAccountParams struct {
    Address sdk.AccAddress
}

QueryAccountParams defines the params for querying accounts.

func NewQueryAccountParams Uses

func NewQueryAccountParams(addr sdk.AccAddress) QueryAccountParams

NewQueryAccountParams creates a new instance of QueryAccountParams.

type StdFee Uses

type StdFee struct {
    Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
    Gas    uint64                                   `protobuf:"varint,2,opt,name=gas,proto3" json:"gas,omitempty"`
}

StdFee includes the amount of coins paid in fees and the maximum gas to be used by the transaction. The ratio yields an effective "gasprice", which must be above some miminum to be accepted into the mempool.

func NewStdFee Uses

func NewStdFee(gas uint64, amount sdk.Coins) StdFee

NewStdFee returns a new instance of StdFee

func NewTestStdFee Uses

func NewTestStdFee() StdFee

func (StdFee) Bytes Uses

func (fee StdFee) Bytes() []byte

Bytes for signing later

func (*StdFee) Descriptor Uses

func (*StdFee) Descriptor() ([]byte, []int)

func (*StdFee) Equal Uses

func (this *StdFee) Equal(that interface{}) bool

func (StdFee) GasPrices Uses

func (fee StdFee) GasPrices() sdk.DecCoins

GasPrices returns the gas prices for a StdFee.

NOTE: The gas prices returned are not the true gas prices that were originally part of the submitted transaction because the fee is computed as fee = ceil(gasWanted * gasPrices).

func (*StdFee) GetAmount Uses

func (m *StdFee) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins

func (*StdFee) GetGas Uses

func (m *StdFee) GetGas() uint64

func (*StdFee) Marshal Uses

func (m *StdFee) Marshal() (dAtA []byte, err error)

func (*StdFee) MarshalTo Uses

func (m *StdFee) MarshalTo(dAtA []byte) (int, error)

func (*StdFee) MarshalToSizedBuffer Uses

func (m *StdFee) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StdFee) ProtoMessage Uses

func (*StdFee) ProtoMessage()

func (*StdFee) Reset Uses

func (m *StdFee) Reset()

func (*StdFee) Size Uses

func (m *StdFee) Size() (n int)

func (*StdFee) String Uses

func (m *StdFee) String() string

func (*StdFee) Unmarshal Uses

func (m *StdFee) Unmarshal(dAtA []byte) error

func (*StdFee) XXX_DiscardUnknown Uses

func (m *StdFee) XXX_DiscardUnknown()

func (*StdFee) XXX_Marshal Uses

func (m *StdFee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StdFee) XXX_Merge Uses

func (m *StdFee) XXX_Merge(src proto.Message)

func (*StdFee) XXX_Size Uses

func (m *StdFee) XXX_Size() int

func (*StdFee) XXX_Unmarshal Uses

func (m *StdFee) XXX_Unmarshal(b []byte) error

type StdSignDoc Uses

type StdSignDoc struct {
    AccountNumber uint64            `json:"account_number" yaml:"account_number"`
    ChainID       string            `json:"chain_id" yaml:"chain_id"`
    Fee           json.RawMessage   `json:"fee" yaml:"fee"`
    Memo          string            `json:"memo" yaml:"memo"`
    Msgs          []json.RawMessage `json:"msgs" yaml:"msgs"`
    Sequence      uint64            `json:"sequence" yaml:"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 Uses

type StdSignMsg struct {
    ChainID       string    `json:"chain_id" yaml:"chain_id"`
    AccountNumber uint64    `json:"account_number" yaml:"account_number"`
    Sequence      uint64    `json:"sequence" yaml:"sequence"`
    Fee           StdFee    `json:"fee" yaml:"fee"`
    Msgs          []sdk.Msg `json:"msgs" yaml:"msgs"`
    Memo          string    `json:"memo" yaml:"memo"`
}

StdSignMsg is a convenience structure for passing along a Msg with the other requirements for a StdSignDoc before it is signed. For use in the CLI.

func (StdSignMsg) Bytes Uses

func (msg StdSignMsg) Bytes() []byte

get message bytes

type StdSignature Uses

type StdSignature struct {
    crypto.PubKey `json:"pub_key" yaml:"pub_key"` // optional
    Signature     []byte                          `json:"signature" yaml:"signature"`
}

StdSignature represents a sig

func MakeSignature Uses

func MakeSignature(keybase keys.Keybase, name, passphrase string,
    msg StdSignMsg) (sig StdSignature, err error)

MakeSignature builds a StdSignature given keybase, key name, passphrase, and a StdSignMsg.

func (StdSignature) MarshalYAML Uses

func (ss StdSignature) MarshalYAML() (interface{}, error)

MarshalYAML returns the YAML representation of the signature.

type StdTx Uses

type StdTx struct {
    Msgs       []sdk.Msg      `json:"msg" yaml:"msg"`
    Fee        StdFee         `json:"fee" yaml:"fee"`
    Signatures []StdSignature `json:"signatures" yaml:"signatures"`
    Memo       string         `json:"memo" yaml:"memo"`
}

StdTx is a standard way to wrap a Msg with Fee and Signatures. NOTE: the first signature is the fee payer (Signatures must not be nil).

func NewStdTx Uses

func NewStdTx(msgs []sdk.Msg, fee StdFee, sigs []StdSignature, memo string) StdTx

func (StdTx) FeePayer Uses

func (tx StdTx) FeePayer() sdk.AccAddress

FeePayer returns the address that is responsible for paying fee StdTx returns the first signer as the fee payer If no signers for tx, return empty address

func (StdTx) GetFee Uses

func (tx StdTx) GetFee() sdk.Coins

GetFee returns the FeeAmount in StdFee

func (StdTx) GetGas Uses

func (tx StdTx) GetGas() uint64

GetGas returns the Gas in StdFee

func (StdTx) GetMemo Uses

func (tx StdTx) GetMemo() string

GetMemo returns the memo

func (StdTx) GetMsgs Uses

func (tx StdTx) GetMsgs() []sdk.Msg

GetMsgs returns the all the transaction's messages.

func (StdTx) GetPubKeys Uses

func (tx StdTx) GetPubKeys() []crypto.PubKey

GetPubkeys returns the pubkeys of signers if the pubkey is included in the signature If pubkey is not included in the signature, then nil is in the slice instead

func (StdTx) GetSignBytes Uses

func (tx StdTx) GetSignBytes(ctx sdk.Context, acc exported.Account) []byte

GetSignBytes returns the signBytes of the tx for a given signer

func (StdTx) GetSignatures Uses

func (tx StdTx) GetSignatures() [][]byte

GetSignatures returns the signature of signers who signed the Msg. CONTRACT: Length returned is same as length of pubkeys returned from MsgKeySigners, and the order matches. CONTRACT: If the signature is missing (ie the Msg is invalid), then the corresponding signature is .Empty().

func (StdTx) GetSigners Uses

func (tx StdTx) GetSigners() []sdk.AccAddress

GetSigners returns the addresses that must sign the transaction. Addresses are returned in a deterministic order. They are accumulated from the GetSigners method for each Msg in the order they appear in tx.GetMsgs(). Duplicate addresses will be omitted.

func (StdTx) ValidateBasic Uses

func (tx StdTx) ValidateBasic() error

ValidateBasic does a simple and lightweight validation check that doesn't require access to any other information.

type SupplyKeeper Uses

type SupplyKeeper interface {
    SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
    GetModuleAccount(ctx sdk.Context, moduleName string) exported.ModuleAccountI
    GetModuleAddress(moduleName string) sdk.AccAddress
}

SupplyKeeper defines the expected supply Keeper (noalias)

type TxBuilder Uses

type TxBuilder struct {
    // contains filtered or unexported fields
}

TxBuilder implements a transaction context created in SDK modules.

func NewTxBuilder Uses

func NewTxBuilder(
    txEncoder sdk.TxEncoder, accNumber, seq, gas uint64, gasAdj float64,
    simulateAndExecute bool, chainID, memo string, fees sdk.Coins, gasPrices sdk.DecCoins,
) TxBuilder

NewTxBuilder returns a new initialized TxBuilder.

func NewTxBuilderFromCLI Uses

func NewTxBuilderFromCLI(input io.Reader) TxBuilder

NewTxBuilderFromCLI returns a new initialized TxBuilder with parameters from the command line using Viper.

func (TxBuilder) AccountNumber Uses

func (bldr TxBuilder) AccountNumber() uint64

AccountNumber returns the account number

func (TxBuilder) BuildAndSign Uses

func (bldr TxBuilder) BuildAndSign(name, passphrase string, msgs []sdk.Msg) ([]byte, error)

BuildAndSign builds a single message to be signed, and signs a transaction with the built message given a name, passphrase, and a set of messages.

func (TxBuilder) BuildSignMsg Uses

func (bldr TxBuilder) BuildSignMsg(msgs []sdk.Msg) (StdSignMsg, error)

BuildSignMsg builds a single message to be signed from a TxBuilder given a set of messages. It returns an error if a fee is supplied but cannot be parsed.

func (TxBuilder) BuildTxForSim Uses

func (bldr TxBuilder) BuildTxForSim(msgs []sdk.Msg) ([]byte, error)

BuildTxForSim creates a StdSignMsg and encodes a transaction with the StdSignMsg with a single empty StdSignature for tx simulation.

func (TxBuilder) ChainID Uses

func (bldr TxBuilder) ChainID() string

ChainID returns the chain id

func (TxBuilder) Fees Uses

func (bldr TxBuilder) Fees() sdk.Coins

Fees returns the fees for the transaction

func (TxBuilder) Gas Uses

func (bldr TxBuilder) Gas() uint64

Gas returns the gas for the transaction

func (TxBuilder) GasAdjustment Uses

func (bldr TxBuilder) GasAdjustment() float64

GasAdjustment returns the gas adjustment

func (TxBuilder) GasPrices Uses

func (bldr TxBuilder) GasPrices() sdk.DecCoins

GasPrices returns the gas prices set for the transaction, if any.

func (TxBuilder) Keybase Uses

func (bldr TxBuilder) Keybase() keys.Keybase

Keybase returns the keybase

func (TxBuilder) Memo Uses

func (bldr TxBuilder) Memo() string

Memo returns the memo message

func (TxBuilder) Sequence Uses

func (bldr TxBuilder) Sequence() uint64

Sequence returns the transaction sequence

func (TxBuilder) Sign Uses

func (bldr TxBuilder) Sign(name, passphrase string, msg StdSignMsg) ([]byte, error)

Sign signs a transaction given a name, passphrase, and a single message to signed. An error is returned if signing fails.

func (TxBuilder) SignStdTx Uses

func (bldr TxBuilder) SignStdTx(name, passphrase string, stdTx StdTx, appendSig bool) (signedStdTx StdTx, err error)

SignStdTx appends a signature to a StdTx and returns a copy of it. If append is false, it replaces the signatures already attached with the new signature.

func (TxBuilder) SimulateAndExecute Uses

func (bldr TxBuilder) SimulateAndExecute() bool

SimulateAndExecute returns the option to simulate and then execute the transaction using the gas from the simulation results

func (TxBuilder) TxEncoder Uses

func (bldr TxBuilder) TxEncoder() sdk.TxEncoder

TxEncoder returns the transaction encoder

func (TxBuilder) WithAccountNumber Uses

func (bldr TxBuilder) WithAccountNumber(accnum uint64) TxBuilder

WithAccountNumber returns a copy of the context with an account number.

func (TxBuilder) WithChainID Uses

func (bldr TxBuilder) WithChainID(chainID string) TxBuilder

WithChainID returns a copy of the context with an updated chainID.

func (TxBuilder) WithFees Uses

func (bldr TxBuilder) WithFees(fees string) TxBuilder

WithFees returns a copy of the context with an updated fee.

func (TxBuilder) WithGas Uses

func (bldr TxBuilder) WithGas(gas uint64) TxBuilder

WithGas returns a copy of the context with an updated gas.

func (TxBuilder) WithGasPrices Uses

func (bldr TxBuilder) WithGasPrices(gasPrices string) TxBuilder

WithGasPrices returns a copy of the context with updated gas prices.

func (TxBuilder) WithKeybase Uses

func (bldr TxBuilder) WithKeybase(keybase keys.Keybase) TxBuilder

WithKeybase returns a copy of the context with updated keybase.

func (TxBuilder) WithMemo Uses

func (bldr TxBuilder) WithMemo(memo string) TxBuilder

WithMemo returns a copy of the context with an updated memo.

func (TxBuilder) WithSequence Uses

func (bldr TxBuilder) WithSequence(sequence uint64) TxBuilder

WithSequence returns a copy of the context with an updated sequence number.

func (TxBuilder) WithTxEncoder Uses

func (bldr TxBuilder) WithTxEncoder(txEncoder sdk.TxEncoder) TxBuilder

WithTxEncoder returns a copy of the context with an updated codec.

Package types imports 25 packages (graph) and is imported by 37 packages. Updated 2020-02-28. Refresh now. Tools for package owners.