context

package
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 11 Imported by: 39

Documentation

Overview

nolint

Index

Constants

View Source
const ContextKeySigners contextKey = 99999

ContextKeySigners 用于保存tx中签名的账户

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	context.Context
	// contains filtered or unexported fields
}

The intent of Context is for it to be an immutable object that can be cloned and updated cheaply with WithValue() and passed forward to the next decorator or handler. For example,

func MsgHandler(ctx Context, tx Tx) Result {
	...
	ctx = ctx.WithValue(key, value)
	...
}

func NewContext

func NewContext(ms store.MultiStore, header abci.Header, isCheckTx bool, logger log.Logger, registSeedMapper map[string]mapper.IMapper) Context

create a new context nolint: unparam

func (Context) BlockHeader

func (c Context) BlockHeader() abci.Header

func (Context) BlockHeight

func (c Context) BlockHeight() int64

func (Context) BlockTxIndex

func (c Context) BlockTxIndex() int64

func (Context) CacheContext

func (c Context) CacheContext() (cc Context, writeCache func())

Cache the multistore and return a new cached context. The cached context is written to the context when writeCache is called.

func (Context) ChainID

func (c Context) ChainID() string

func (Context) ConsensusParams

func (c Context) ConsensusParams() *abci.ConsensusParams

func (Context) EventManager added in v0.2.2

func (c Context) EventManager() *types.EventManager

func (Context) GasMeter

func (c Context) GasMeter() types.GasMeter

func (Context) GetOp

func (c Context) GetOp(ver int64) (Op, bool)

Returns false if ver <= 0 || ver > len(c.pst.ops). The first operation is version 1.

func (Context) IsCheckTx

func (c Context) IsCheckTx() bool

func (Context) IsZero

func (c Context) IsZero() bool

is context nil

func (Context) KVStore

func (c Context) KVStore(key store.StoreKey) store.KVStore

KVStore fetches a KVStore from the MultiStore.

func (Context) Logger

func (c Context) Logger() log.Logger

func (Context) Mapper

func (c Context) Mapper(name string) mapper.IMapper

func (Context) MinimumFees

func (c Context) MinimumFees() []types.Coin

func (Context) MultiStore added in v0.0.10

func (c Context) MultiStore() store.MultiStore

NOTE: Do not expose MultiStore. MultiStore exposes all the keys. Instead, pass the context and the store key.

func (Context) ResetBlockTxIndex

func (c Context) ResetBlockTxIndex() Context

func (Context) TransientStore

func (c Context) TransientStore(key store.StoreKey) store.KVStore

TransientStore fetches a TransientStore from the MultiStore.

func (Context) TxBytes

func (c Context) TxBytes() []byte

func (Context) TxQcpResultHandler

func (c Context) TxQcpResultHandler() func(ctx Context, itx interface{})

func (Context) Value

func (c Context) Value(key interface{}) interface{}

context value for the provided key

func (Context) VoteInfos added in v0.0.10

func (c Context) VoteInfos() []abci.VoteInfo

func (Context) WithBlockGasMeter added in v0.0.10

func (c Context) WithBlockGasMeter(meter types.GasMeter) Context

func (Context) WithBlockHeader

func (c Context) WithBlockHeader(header abci.Header) Context

func (Context) WithBlockHeight

func (c Context) WithBlockHeight(height int64) Context

func (Context) WithBlockTime added in v0.0.10

func (c Context) WithBlockTime(newTime time.Time) Context

func (Context) WithBlockTxIndex

func (c Context) WithBlockTxIndex(blockTxIndex int64) Context

func (Context) WithCacheWrapper

func (c Context) WithCacheWrapper(key interface{}, value store.CacheWrapper) Context

func (Context) WithChainID

func (c Context) WithChainID(chainID string) Context

func (Context) WithCloner

func (c Context) WithCloner(key interface{}, value cloner) Context

func (Context) WithConsensusParams

func (c Context) WithConsensusParams(params *abci.ConsensusParams) Context

func (Context) WithEventManager added in v0.2.2

func (c Context) WithEventManager(em *types.EventManager) Context

func (Context) WithGasMeter

func (c Context) WithGasMeter(meter types.GasMeter) Context

func (Context) WithInt32

func (c Context) WithInt32(key interface{}, value int32) Context

func (Context) WithIsCheckTx

func (c Context) WithIsCheckTx(isCheckTx bool) Context

func (Context) WithLogger

func (c Context) WithLogger(logger log.Logger) Context

func (Context) WithMinimumFees

func (c Context) WithMinimumFees(minFees []types.Coin) Context

func (Context) WithMultiStore

func (c Context) WithMultiStore(ms store.MultiStore) Context

func (Context) WithProposer added in v0.0.10

func (c Context) WithProposer(addr types.ConsAddress) Context

func (Context) WithProtoMsg

func (c Context) WithProtoMsg(key interface{}, value proto.Message) Context

func (Context) WithString

func (c Context) WithString(key interface{}, value string) Context

func (Context) WithTxBytes

func (c Context) WithTxBytes(txBytes []byte) Context

func (Context) WithTxQcpResultHandler

func (c Context) WithTxQcpResultHandler(txQcpResultHandler func(ctx Context, itx interface{})) Context

func (Context) WithUint32

func (c Context) WithUint32(key interface{}, value uint32) Context

func (Context) WithUint64

func (c Context) WithUint64(key interface{}, value uint64) Context

func (Context) WithValue

func (c Context) WithValue(key interface{}, value interface{}) Context

nolint

func (Context) WithVoteInfos added in v0.0.10

func (c Context) WithVoteInfos(VoteInfos []abci.VoteInfo) Context

type Op

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

XXX add description

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL