Documentation ¶
Index ¶
- Constants
- func NewCallContext(wc WorldContext, from module.Address) icmodule.CallContext
- func NewConfig() *config
- type Block
- type Env
- func (env *Env) RegisterPReps() ([]Receipt, error)
- func (env *Env) SetBonderLists() ([]Receipt, error)
- func (env *Env) SetBonds() ([]Receipt, error)
- func (env *Env) SetDelegations(addrs []module.Address, amount *big.Int) ([]Receipt, error)
- func (env *Env) SetDelegationsAll() error
- func (env *Env) SetStakes(addrs []module.Address, amount *big.Int) ([]Receipt, error)
- func (env *Env) SetStakesAll() ([]Receipt, error)
- type Receipt
- type RewardFund
- type Simulator
- type Transaction
- type TxType
- type WorldContext
Constants ¶
View Source
const ( Failure = 0 Success = 1 )
Variables ¶
This section is empty.
Functions ¶
func NewCallContext ¶
func NewCallContext(wc WorldContext, from module.Address) icmodule.CallContext
Types ¶
type Block ¶
type Block interface { Txs() []Transaction AddTransaction(tx Transaction) }
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
func (*Env) RegisterPReps ¶
RegisterPReps register all preps in Env
func (*Env) SetBonderLists ¶
func (*Env) SetDelegations ¶
func (*Env) SetDelegationsAll ¶
func (*Env) SetStakesAll ¶
type Receipt ¶
func NewReceipt ¶
type RewardFund ¶
type Simulator ¶
type Simulator interface { Database() db.Database BlockHeight() int64 Revision() module.Revision GetBalance(from module.Address) *big.Int TotalSupply() *big.Int ValidatorList() []module.Validator GetPRepTerm() map[string]interface{} GetMainPReps() map[string]interface{} GetSubPReps() map[string]interface{} GetPReps() map[string]interface{} TermSnapshot() *icstate.TermSnapshot Go(blocks int64, csi module.ConsensusInfo) error GoTo(blockHeight int64, csi module.ConsensusInfo) error GoToTermEnd(csi module.ConsensusInfo) error GoByBlock(block Block, csi module.ConsensusInfo) ([]Receipt, error) GoByTransaction(tx Transaction, csi module.ConsensusInfo) ([]Receipt, error) SetRevision(revision module.Revision) Transaction GetStake(from module.Address) map[string]interface{} SetStake(from module.Address, amount *big.Int) Transaction QueryIScore(address module.Address) *big.Int ClaimIScore(from module.Address) Transaction GetPRepStats(address module.Address) map[string]interface{} GetPRep(address module.Address) *icstate.PRep SetPRep(from module.Address, info *icstate.PRepInfo) Transaction GetDelegation(address module.Address) map[string]interface{} SetDelegation(from module.Address, ds icstate.Delegations) Transaction GetBond(address module.Address) map[string]interface{} SetBond(from module.Address, bonds icstate.Bonds) Transaction GetBonderList(address module.Address) map[string]interface{} SetBonderList(from module.Address, bl icstate.BonderList) Transaction RegisterPRep(from module.Address, info *icstate.PRepInfo) Transaction UnregisterPRep(from module.Address) Transaction DisqualifyPRep(from module.Address, address module.Address) Transaction }
type Transaction ¶
type Transaction interface { Type() TxType Args() []interface{} }
func NewTransaction ¶
func NewTransaction(txType TxType, args []interface{}) Transaction
type WorldContext ¶
type WorldContext interface { icmodule.WorldContext GetExtensionState() state.ExtensionState BlockTimeStamp() int64 }
func NewWorldContext ¶
func NewWorldContext( ws state.WorldState, blockHeight int64, revision module.Revision, csi module.ConsensusInfo, stepPrice *big.Int, ) WorldContext
Click to show internal directories.
Click to hide internal directories.