Documentation ¶
Index ¶
- Variables
- func NewBaseTx(blk, parent *block.Block, witnessList *blockcache.WitnessList) (*tx.Tx, error)
- type Config
- type Executor
- func (v *Executor) Exec(bh *block.BlockHead, db database.IMultiValue, t *tx.Tx, limit time.Duration) (*tx.TxReceipt, error)
- func (v *Executor) Gen(blk, parent *block.Block, witnessList *blockcache.WitnessList, ...) (droplist []*tx.Tx, errs []error, err error)
- func (v *Executor) Try(bh *block.BlockHead, db database.IMultiValue, t *tx.Tx, limit time.Duration) (*tx.TxReceipt, error)
- 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) DeploySystemContract(c *contract.Contract, publisher string, kp *account.KeyPair) (*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
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 Executor ¶ added in v3.7.0
type Executor struct { }
func (*Executor) Exec ¶ added in v3.7.0
func (v *Executor) 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 (*Executor) Gen ¶ added in v3.7.0
func (v *Executor) 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
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, otherArgs ...any) (*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) DeploySystemContract ¶
func (s *Simulator) DeploySystemContract(c *contract.Contract, publisher string, kp *account.KeyPair) (*tx.TxReceipt, error)
DeploySystemContract via system.iost/initSetCode
func (*Simulator) SetBlockHead ¶
SetBlockHead ...
func (*Simulator) SetContract ¶
SetContract without run init
type Verifier ¶
type Verifier struct { }
Verifier ..
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.