Documentation ¶
Index ¶
- Variables
- func NewBaseTx(blk, parent *block.Block, witnessList *blockcache.WitnessList) (*tx.Tx, error)
- func Resolve(mappers []map[string]database.Access) (accept, drop []int)
- type Batch
- type Batcher
- type Config
- type Info
- type Provider
- type ProviderImpl
- type Simulator
- func (s *Simulator) Call(contractName, abi, args string, publisher string, auth *account.KeyPair) (*tx.TxReceipt, error)
- func (s *Simulator) CallTx(trx *tx.Tx, publisher string, auth *account.KeyPair) (*tx.TxReceipt, error)
- func (s *Simulator) Clear()
- func (s *Simulator) Compile(id, src, abi string) (*contract.Contract, error)
- func (s *Simulator) DeployContract(c *contract.Contract, publisher string, kp *account.KeyPair) (string, *tx.TxReceipt, error)
- func (s *Simulator) GetGas(id string) int64
- func (s *Simulator) GetRAM(id string) int64
- func (s *Simulator) RunTx(stx *tx.Tx) (*tx.TxReceipt, error)
- func (s *Simulator) SetAccount(acc *account.Account)
- func (s *Simulator) SetBlockHead(head *block.BlockHead)
- func (s *Simulator) SetContract(c *contract.Contract)
- func (s *Simulator) SetGas(id string, i int64)
- func (s *Simulator) SetRAM(id string, r int64)
- type Verifier
- func (v *Verifier) Exec(bh *block.BlockHead, db database.IMultiValue, t *tx.Tx, limit time.Duration) (*tx.TxReceipt, error)
- func (v *Verifier) Gen(blk, parent *block.Block, witnessList *blockcache.WitnessList, ...) (droplist []*tx.Tx, errs []error, err error)
- func (v *Verifier) Try(bh *block.BlockHead, db database.IMultiValue, t *tx.Tx, limit time.Duration) (*tx.TxReceipt, error)
- func (v *Verifier) Verify(blk, parent *block.Block, witnessList *blockcache.WitnessList, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrExpiredTx = errors.New("expired tx") ErrNotArrivedTx = errors.New("not arrived tx") ErrInvalidMode = errors.New("invalid mode") )
values
Functions ¶
func NewBaseTx ¶
func NewBaseTx(blk, parent *block.Block, witnessList *blockcache.WitnessList) (*tx.Tx, error)
NewBaseTx is new baseTx
Types ¶
type Batcher ¶
type Batcher interface { Batch(bh *block.BlockHead, db database.IMultiValue, provider Provider, limit time.Duration, thread int) *Batch Verify(bh *block.BlockHead, db database.IMultiValue, checkFunc func(e vm.Isolator, t *tx.Tx, r *tx.TxReceipt) error, b *Batch) error }
Batcher batch generator and verifier
type ProviderImpl ¶
type ProviderImpl struct {
// contains filtered or unexported fields
}
ProviderImpl impl of provider
type Simulator ¶
type Simulator struct { Visitor *database.Visitor Verifier *Verifier Head *block.BlockHead Logger *ilog.Logger Mvcc db.MVCCDB GasLimit int64 }
Simulator of txs and contract
func NewSimulator ¶
func NewSimulator() *Simulator
NewSimulator get a simulator with default settings
func (*Simulator) Call ¶
func (s *Simulator) Call(contractName, abi, args string, publisher string, auth *account.KeyPair) (*tx.TxReceipt, error)
Call abi with basic settings
func (*Simulator) CallTx ¶
func (s *Simulator) CallTx(trx *tx.Tx, publisher string, auth *account.KeyPair) (*tx.TxReceipt, error)
CallTx with user defiened tx
func (*Simulator) DeployContract ¶
func (s *Simulator) DeployContract(c *contract.Contract, publisher string, kp *account.KeyPair) (string, *tx.TxReceipt, error)
DeployContract via system.iost/setCode
func (*Simulator) SetBlockHead ¶
SetBlockHead ...
func (*Simulator) SetContract ¶
SetContract without run init
type Verifier ¶
type Verifier struct { }
Verifier ..
func (*Verifier) Exec ¶
func (v *Verifier) Exec(bh *block.BlockHead, db database.IMultiValue, t *tx.Tx, limit time.Duration) (*tx.TxReceipt, error)
Exec exec single tx and flush changes to db
func (*Verifier) Gen ¶
func (v *Verifier) Gen(blk, parent *block.Block, witnessList *blockcache.WitnessList, db database.IMultiValue, iter *txpool.SortedTxMap, c *Config) (droplist []*tx.Tx, errs []error, err error)
Gen gen block
func (*Verifier) Try ¶
func (v *Verifier) Try(bh *block.BlockHead, db database.IMultiValue, t *tx.Tx, limit time.Duration) (*tx.TxReceipt, error)
Try exec tx and only return receipt
func (*Verifier) Verify ¶
func (v *Verifier) Verify(blk, parent *block.Block, witnessList *blockcache.WitnessList, db database.IMultiValue, c *Config) error
Verify verify block generated by Verifier
Click to show internal directories.
Click to hide internal directories.