Documentation ¶
Index ¶
- Constants
- func AllocAward(wasm *wasm.WASM, logger log.Logger) error
- func ApplyMessage(vmenv vm.VmInterface, msg types.Message, tokenAddr common.Address) (ret []byte, gas uint64, byteCodeGas uint64, fee *big.Int, refundFee uint64, ...)
- func CallWasmContract(wasm *wasm.WASM, sender, contractAddr common.Address, amount *big.Int, ...) ([]byte, error)
- func GenerateTransaction(txi types.Tx, state *state.StateDB, vmenv *vm.VmFactory) (txo *processTransaction, err error)
- func GetCoefficient(statedb types.StateDB, logger log.Logger) *types.Coefficient
- func SetPoceeds(wasm *wasm.WASM, coinbase common.Address, amount *big.Int, logger log.Logger) error
- type AwardHandle
- type LinkApplication
- func (app *LinkApplication) Block() *types.Block
- func (app *LinkApplication) BlockChain() types.BlockChain
- func (app *LinkApplication) CheckBlock(block *types.Block) bool
- func (app *LinkApplication) CheckBlockInCommit(block *types.Block) bool
- func (app *LinkApplication) CheckTx(tx types.Tx, checkBasic bool) error
- func (app *LinkApplication) CommitBlock(block *types.Block, blockParts *types.PartSet, seenCommit *types.Commit, ...) ([]*types.Validator, error)
- func (app *LinkApplication) CreateBlock(height uint64, maxTxs int, gasLimit uint64, timeUnix uint64) *types.Block
- func (app *LinkApplication) GetBalance(addr common.Address) *big.Int
- func (app *LinkApplication) GetLastChangedVals() (height uint64, vals []*types.Validator)
- func (app *LinkApplication) GetLatestStateDB() *state.StateDB
- func (app *LinkApplication) GetNonce(addr common.Address) uint64
- func (app *LinkApplication) GetPendingBlock() *types.Block
- func (app *LinkApplication) GetPendingStateDB() *state.StateDB
- func (app *LinkApplication) GetRecoverValidators(height uint64) []*types.Validator
- func (app *LinkApplication) GetStorageRoot(addr common.Address) common.Hash
- func (app *LinkApplication) GetUTXOChangeRate(addr common.Address) (int64, error)
- func (app *LinkApplication) GetUTXOGas() uint64
- func (app *LinkApplication) GetValidators(height uint64) []*types.Validator
- func (app *LinkApplication) Height() uint64
- func (app *LinkApplication) IsWasmContract(data []byte) bool
- func (app *LinkApplication) LoadBlock(height uint64) *types.Block
- func (app *LinkApplication) LoadBlockCommit(height uint64) *types.Commit
- func (app *LinkApplication) LoadBlockMeta(height uint64) *types.BlockMeta
- func (app *LinkApplication) LoadBlockPart(height uint64, index int) *types.Part
- func (app *LinkApplication) LoadSeenCommit(height uint64) *types.Commit
- func (app *LinkApplication) LockState()
- func (app *LinkApplication) Mempool() types.Mempool
- func (app *LinkApplication) PreRunBlock(block *types.Block)
- func (app *LinkApplication) SetConm(conM *p2p.ConManager)
- func (app *LinkApplication) SetLastChangedVals(height uint64, vals []*types.Validator)
- func (app *LinkApplication) SetLogger(l log.Logger)
- func (app *LinkApplication) SetMempool(mempool types.Mempool)
- func (app *LinkApplication) State() types.State
- func (app *LinkApplication) TxMgr() types.TxMgr
- func (app *LinkApplication) UTXOStore() types.UTXOStore
- func (app *LinkApplication) UnlockState()
- type Mempool
- func (_m *Mempool) GetTxFromCache(_a0 common.Hash) types.Tx
- func (_m *Mempool) KeyImageExists(key cryptonotetypes.Key) bool
- func (_m *Mempool) KeyImagePush(key cryptonotetypes.Key) bool
- func (_m *Mempool) KeyImageRemoveKeys(_a0 []*cryptonotetypes.Key)
- func (_m *Mempool) KeyImageReset()
- func (_m *Mempool) Lock()
- func (_m *Mempool) Reap(maxTxs int) types.Txs
- func (_m *Mempool) Unlock()
- func (_m *Mempool) Update(height uint64, txs types.Txs) error
- type PoceedHandle
- type ProcessResult
- type Processor
- type StateProcessor
- type TransitionResult
Constants ¶
const ( // Inputs Ain = "ain" Uin = "uin" // Outputs Aout = "aout" Uout = "uout" Cout = "cout" Createout = "createout" Updateout = "updateout" )
Variables ¶
This section is empty.
Functions ¶
func ApplyMessage ¶
func ApplyMessage(vmenv vm.VmInterface, msg types.Message, tokenAddr common.Address) (ret []byte, gas uint64, byteCodeGas uint64, fee *big.Int, refundFee uint64, vmerr error, err error)
Deprecated
func CallWasmContract ¶
func CallWasmContract(wasm *wasm.WASM, sender, contractAddr common.Address, amount *big.Int, input []byte, logger log.Logger) ([]byte, error)
CallWasmContract only be used by chain inner to call wasm contract directly
func GenerateTransaction ¶ added in v0.1.2
func GetCoefficient ¶
Types ¶
type LinkApplication ¶
type LinkApplication struct {
// contains filtered or unexported fields
}
func NewLinkApplication ¶
func NewLinkApplication(db dbm.DB, bc *blockchain.BlockStore, utxoStore *utxo.UtxoStore, txService txmgr.CrossState, eventbus *types.EventBus, isTrie bool, brs *blockchain.BalanceRecordStore, poceedHandle PoceedHandle, awardHandle AwardHandle) (*LinkApplication, error)
func (*LinkApplication) Block ¶
func (app *LinkApplication) Block() *types.Block
func (*LinkApplication) BlockChain ¶
func (app *LinkApplication) BlockChain() types.BlockChain
func (*LinkApplication) CheckBlock ¶
func (app *LinkApplication) CheckBlock(block *types.Block) bool
func (*LinkApplication) CheckBlockInCommit ¶
func (app *LinkApplication) CheckBlockInCommit(block *types.Block) bool
XXX DEPRECATED
func (*LinkApplication) CheckTx ¶
func (app *LinkApplication) CheckTx(tx types.Tx, checkBasic bool) error
CheckTx assumes that txs' signature has been verified before.
func (*LinkApplication) CommitBlock ¶
func (*LinkApplication) CreateBlock ¶
func (*LinkApplication) GetBalance ¶
func (app *LinkApplication) GetBalance(addr common.Address) *big.Int
func (*LinkApplication) GetLastChangedVals ¶
func (app *LinkApplication) GetLastChangedVals() (height uint64, vals []*types.Validator)
func (*LinkApplication) GetLatestStateDB ¶
func (app *LinkApplication) GetLatestStateDB() *state.StateDB
func (*LinkApplication) GetPendingBlock ¶
func (app *LinkApplication) GetPendingBlock() *types.Block
func (*LinkApplication) GetPendingStateDB ¶
func (app *LinkApplication) GetPendingStateDB() *state.StateDB
func (*LinkApplication) GetRecoverValidators ¶
func (app *LinkApplication) GetRecoverValidators(height uint64) []*types.Validator
GetRecoverValidators return both white list and candidates
func (*LinkApplication) GetStorageRoot ¶
func (app *LinkApplication) GetStorageRoot(addr common.Address) common.Hash
func (*LinkApplication) GetUTXOChangeRate ¶ added in v0.1.3
func (app *LinkApplication) GetUTXOChangeRate(addr common.Address) (int64, error)
func (*LinkApplication) GetUTXOGas ¶
func (app *LinkApplication) GetUTXOGas() uint64
func (*LinkApplication) GetValidators ¶
func (app *LinkApplication) GetValidators(height uint64) []*types.Validator
func (*LinkApplication) Height ¶
func (app *LinkApplication) Height() uint64
func (*LinkApplication) IsWasmContract ¶
func (app *LinkApplication) IsWasmContract(data []byte) bool
func (*LinkApplication) LoadBlock ¶
func (app *LinkApplication) LoadBlock(height uint64) *types.Block
func (*LinkApplication) LoadBlockCommit ¶
func (app *LinkApplication) LoadBlockCommit(height uint64) *types.Commit
func (*LinkApplication) LoadBlockMeta ¶
func (app *LinkApplication) LoadBlockMeta(height uint64) *types.BlockMeta
func (*LinkApplication) LoadBlockPart ¶
func (app *LinkApplication) LoadBlockPart(height uint64, index int) *types.Part
func (*LinkApplication) LoadSeenCommit ¶
func (app *LinkApplication) LoadSeenCommit(height uint64) *types.Commit
func (*LinkApplication) LockState ¶
func (app *LinkApplication) LockState()
func (*LinkApplication) Mempool ¶
func (app *LinkApplication) Mempool() types.Mempool
func (*LinkApplication) PreRunBlock ¶
func (app *LinkApplication) PreRunBlock(block *types.Block)
func (*LinkApplication) SetConm ¶
func (app *LinkApplication) SetConm(conM *p2p.ConManager)
func (*LinkApplication) SetLastChangedVals ¶
func (app *LinkApplication) SetLastChangedVals(height uint64, vals []*types.Validator)
func (*LinkApplication) SetLogger ¶
func (app *LinkApplication) SetLogger(l log.Logger)
func (*LinkApplication) SetMempool ¶
func (app *LinkApplication) SetMempool(mempool types.Mempool)
func (*LinkApplication) State ¶
func (app *LinkApplication) State() types.State
func (*LinkApplication) TxMgr ¶
func (app *LinkApplication) TxMgr() types.TxMgr
func (*LinkApplication) UTXOStore ¶
func (app *LinkApplication) UTXOStore() types.UTXOStore
func (*LinkApplication) UnlockState ¶
func (app *LinkApplication) UnlockState()
type Mempool ¶ added in v0.1.2
Mempool is an autogenerated mock type for the Mempool type
func (*Mempool) GetTxFromCache ¶ added in v0.1.2
GetTxFromCache provides a mock function with given fields: _a0
func (*Mempool) KeyImageExists ¶ added in v0.1.2
func (_m *Mempool) KeyImageExists(key cryptonotetypes.Key) bool
KeyImageExists provides a mock function with given fields: key
func (*Mempool) KeyImagePush ¶ added in v0.1.2
func (_m *Mempool) KeyImagePush(key cryptonotetypes.Key) bool
KeyImagePush provides a mock function with given fields: key
func (*Mempool) KeyImageRemoveKeys ¶ added in v0.1.2
func (_m *Mempool) KeyImageRemoveKeys(_a0 []*cryptonotetypes.Key)
KeyImageRemoveKeys provides a mock function with given fields: _a0
func (*Mempool) KeyImageReset ¶ added in v0.1.2
func (_m *Mempool) KeyImageReset()
KeyImageReset provides a mock function with given fields:
func (*Mempool) Lock ¶ added in v0.1.2
func (_m *Mempool) Lock()
Lock provides a mock function with given fields:
type PoceedHandle ¶
type ProcessResult ¶
type ProcessResult struct {
// contains filtered or unexported fields
}
func (*ProcessResult) GetReceipts ¶
func (p *ProcessResult) GetReceipts() *types.Receipts
func (*ProcessResult) GetTxsResult ¶
func (p *ProcessResult) GetTxsResult() *types.TxsResult
type Processor ¶
type Processor interface {
Process(block *types.Block, statedb *state.StateDB, cfg evm.Config) (types.Receipts, []*types.Log, uint64, []types.Tx, []*types.UTXOOutputData, []*lctypes.Key, error)
}
Processor is an interface for processing blocks using a given initial state.
Process takes the block to be processed and the statedb upon which the initial state is based. It should return the receipts generated, amount of gas used in the process and return an error if any of the internal rules failed.
type StateProcessor ¶
type StateProcessor struct {
// contains filtered or unexported fields
}
StateProcessor is a basic Processor, which takes care of transitioning state from one point to another.
StateProcessor implements Processor.
func NewStateProcessor ¶
func NewStateProcessor(bc *blockchain.BlockStore, app *LinkApplication) *StateProcessor
NewStateProcessor initialises a new StateProcessor.