Documentation ¶
Index ¶
- Variables
- func Exec(ctx *types.Context, user common.Address, contAddr common.Address, ...) ([]interface{}, error)
- func GetCC(ctx *types.Context, contAddr common.Address, user common.Address) (*types.ContractContext, error)
- func Owner(cc *types.ContractContext, cont common.Address) (common.Address, error)
- func RegisterContractClass(cont types.Contract, className string) uint64
- func RemoveChain(idx int) (string, error)
- func RemoveTestData() error
- type TestContext
- func (tc *TestContext) AddBlock(seconds uint64, txs []*types.Transaction, signer []key.Key) (hash.Hash256, error)
- func (tc *TestContext) Call(toAddr common.Address, from, method string, params []interface{}) ([]interface{}, error)
- func (tc *TestContext) DeployContract(contType interface{}, contArgs io.WriterTo) common.Address
- func (tc *TestContext) InitChain(adm common.Address) error
- func (tc *TestContext) InitMainToken(adminAddress common.Address, ClassMap map[string]uint64) common.Address
- func (tc *TestContext) MakeToken(name string, symbol string, amt string) common.Address
- func (tc *TestContext) MakeTx(to common.Address, method string, params ...interface{}) (*types.Transaction, error)
- func (tc *TestContext) MultiSendTx(txs []*types.Transaction, keys []key.Key) ([]interface{}, error)
- func (tc *TestContext) MustSendTx(mkey key.Key, to common.Address, method string, params ...interface{}) []interface{}
- func (tc *TestContext) MustSendTxs(txcs []*TxCase) [][]interface{}
- func (tc *TestContext) MustSkipBlock(blockCount int)
- func (tc *TestContext) ReadTx(mkey key.Key, to common.Address, method string, params ...interface{}) ([]interface{}, error)
- func (tc *TestContext) SendTx(mkey key.Key, to common.Address, method string, params ...interface{}) ([]interface{}, error)
- func (tc *TestContext) SkipBlock(blockCount int) (*types.Context, error)
- func (tc *TestContext) Sleep(seconds uint64, tx []*types.Transaction, signer []key.Key) error
- func (tc *TestContext) SleepBlocks(block int)
- type TxCase
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ChainID = big.NewInt(1) Admin = common.HexToAddress("0x477C578843cBe53C3568736347f640c2cdA4616F") AdminKey, _ = key.NewMemoryKeyFromString(ChainID, "a000000000000000000000000000000000000000000000000000000000000999") Users []common.Address UserKeys []key.Key Obstrs = [5]string{ "c000000000000000000000000000000000000000000000000000000000000000", "c000000000000000000000000000000000000000000000000000000000000001", "c000000000000000000000000000000000000000000000000000000000000002", "c000000000000000000000000000000000000000000000000000000000000003", "c000000000000000000000000000000000000000000000000000000000000004", } ObserverKeys = []common.PublicKey{} Frstrs = [10]string{ "b000000000000000000000000000000000000000000000000000000000000010", "b000000000000000000000000000000000000000000000000000000000000011", "b000000000000000000000000000000000000000000000000000000000000012", "b000000000000000000000000000000000000000000000000000000000000013", "b000000000000000000000000000000000000000000000000000000000000014", "b000000000000000000000000000000000000000000000000000000000000015", "b000000000000000000000000000000000000000000000000000000000000016", "b000000000000000000000000000000000000000000000000000000000000017", "b000000000000000000000000000000000000000000000000000000000000018", "b000000000000000000000000000000000000000000000000000000000000019", } )
View Source
var ClassMap map[string]uint64
Functions ¶
func GetCC ¶
func GetCC(ctx *types.Context, contAddr common.Address, user common.Address) (*types.ContractContext, error)
///////// context ///////////
func RegisterContractClass ¶
func RemoveChain ¶
func RemoveTestData ¶
func RemoveTestData() error
Types ¶
type TestContext ¶
func NewTestContext ¶
func NewTestContext() *TestContext
func (*TestContext) AddBlock ¶
func (tc *TestContext) AddBlock(seconds uint64, txs []*types.Transaction, signer []key.Key) (hash.Hash256, error)
func (*TestContext) Call ¶
func (tc *TestContext) Call(toAddr common.Address, from, method string, params []interface{}) ([]interface{}, error)
func (*TestContext) DeployContract ¶
func (tc *TestContext) DeployContract(contType interface{}, contArgs io.WriterTo) common.Address
func (*TestContext) InitMainToken ¶
func (*TestContext) MakeTx ¶
func (tc *TestContext) MakeTx(to common.Address, method string, params ...interface{}) (*types.Transaction, error)
func (*TestContext) MultiSendTx ¶
func (tc *TestContext) MultiSendTx(txs []*types.Transaction, keys []key.Key) ([]interface{}, error)
func (*TestContext) MustSendTx ¶
func (*TestContext) MustSendTxs ¶
func (tc *TestContext) MustSendTxs(txcs []*TxCase) [][]interface{}
func (*TestContext) MustSkipBlock ¶
func (tc *TestContext) MustSkipBlock(blockCount int)
func (*TestContext) SkipBlock ¶
func (tc *TestContext) SkipBlock(blockCount int) (*types.Context, error)
func (*TestContext) Sleep ¶
func (tc *TestContext) Sleep(seconds uint64, tx []*types.Transaction, signer []key.Key) error
func (*TestContext) SleepBlocks ¶
func (tc *TestContext) SleepBlocks(block int)
Click to show internal directories.
Click to hide internal directories.