Documentation ¶
Index ¶
- Constants
- func IsNormativeName(str string) bool
- type APIs
- type ActionApi
- type AssertApi
- type AuthorizationApi
- func (self *AuthorizationApi) IsAccount(address string) bool
- func (self *AuthorizationApi) IsContract(address string) bool
- func (self *AuthorizationApi) IsHexAddress(address string) bool
- func (self *AuthorizationApi) RequireAuth(address string) bool
- func (self *AuthorizationApi) SetCtx(ctx *Context)
- type BlockContext
- type BlockMemDbApi
- func (self *BlockMemDbApi) Emplace(key []byte, val []byte)
- func (self *BlockMemDbApi) Erase(key []byte)
- func (self *BlockMemDbApi) Find(key []byte) []byte
- func (self *BlockMemDbApi) Get(key []byte) []byte
- func (self *BlockMemDbApi) Modify(key []byte, val []byte)
- func (self *BlockMemDbApi) Set(key []byte, val []byte)
- func (self *BlockMemDbApi) SetCtx(ctx *Context)
- type CallApi
- type ConsoleApi
- type Context
- func (ctx *Context) ActionResult() [][]byte
- func (ctx *Context) AppendContract(addr types.Address)
- func (ctx *Context) Code() []byte
- func (ctx *Context) ContractAddress() types.Address
- func (ctx *Context) Exec(in Interpreter) error
- func (ctx *Context) ExecAsync(in Interpreter) error
- func (ctx *Context) GetContracts() []types.Address
- func (ctx *Context) InitForTest()
- func (ctx *Context) InterpreterId() types.Hash
- func (ctx *Context) InterpreterName() string
- func (ctx *Context) Param() []byte
- func (ctx *Context) ResultCh() chan error
- func (self *Context) SetActionResult(data []byte)
- func (ctx *Context) SetCreatorForTest(addr types.Address)
- func (ctx *Context) TTL() time.Duration
- type ContractApi
- type CryptoApi
- type DatabaseApi
- func (self *DatabaseApi) Emplace(key []byte, val []byte)
- func (self *DatabaseApi) Erase(key []byte)
- func (self *DatabaseApi) Find(key []byte) []byte
- func (self *DatabaseApi) Get(key []byte) []byte
- func (self *DatabaseApi) Modify(key []byte, val []byte)
- func (self *DatabaseApi) Set(key []byte, val []byte)
- func (self *DatabaseApi) SetCtx(ctx *Context)
- type Interpreter
- type Name
- type ProducerApi
- type ResultApi
- type SystemApi
- type TypesApi
- type Visitor
Constants ¶
View Source
const (
NotSupport = "not support"
)
assert msg
Variables ¶
This section is empty.
Functions ¶
func IsNormativeName ¶
Types ¶
type APIs ¶
type APIs struct { Auth AuthorizationApi Sys SystemApi Assert AssertApi Console ConsoleApi Crypto CryptoApi Producer ProducerApi Act ActionApi Db DatabaseApi MemDb BlockMemDbApi Contract ContractApi Result ResultApi Call CallApi Types TypesApi }
func (*APIs) SetInterpreter ¶
func (self *APIs) SetInterpreter(interpreter Interpreter)
type AuthorizationApi ¶
type AuthorizationApi struct {
// contains filtered or unexported fields
}
func (*AuthorizationApi) IsAccount ¶
func (self *AuthorizationApi) IsAccount(address string) bool
func (*AuthorizationApi) IsContract ¶
func (self *AuthorizationApi) IsContract(address string) bool
func (*AuthorizationApi) IsHexAddress ¶
func (self *AuthorizationApi) IsHexAddress(address string) bool
func (*AuthorizationApi) RequireAuth ¶
func (self *AuthorizationApi) RequireAuth(address string) bool
type BlockContext ¶
type BlockContext struct {
// contains filtered or unexported fields
}
func NewBlockContext ¶
func (*BlockContext) GetState ¶
func (ctx *BlockContext) GetState() *state.StateDB
type BlockMemDbApi ¶
type BlockMemDbApi struct {
// contains filtered or unexported fields
}
block memory database api
func (*BlockMemDbApi) Emplace ¶
func (self *BlockMemDbApi) Emplace(key []byte, val []byte)
func (*BlockMemDbApi) Erase ¶
func (self *BlockMemDbApi) Erase(key []byte)
func (*BlockMemDbApi) Find ¶
func (self *BlockMemDbApi) Find(key []byte) []byte
func (*BlockMemDbApi) Get ¶
func (self *BlockMemDbApi) Get(key []byte) []byte
func (*BlockMemDbApi) Modify ¶
func (self *BlockMemDbApi) Modify(key []byte, val []byte)
func (*BlockMemDbApi) Set ¶
func (self *BlockMemDbApi) Set(key []byte, val []byte)
type CallApi ¶
type CallApi struct {
// contains filtered or unexported fields
}
func (*CallApi) Call ¶
func (self *CallApi) Call(act *transaction.Action)
func (*CallApi) InnerCall ¶
func (self *CallApi) InnerCall(act *transaction.Action)
func (*CallApi) SetInterpreter ¶
func (self *CallApi) SetInterpreter(interpreter Interpreter)
type ConsoleApi ¶
type ConsoleApi struct {
// contains filtered or unexported fields
}
func (*ConsoleApi) Printf ¶
func (self *ConsoleApi) Printf(str string)
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext(sender types.Address, action *transaction.Action, blkCtx *BlockContext) *Context
func (*Context) ActionResult ¶
func (*Context) AppendContract ¶
func (*Context) ContractAddress ¶
func (*Context) Exec ¶
func (ctx *Context) Exec(in Interpreter) error
func (*Context) ExecAsync ¶
func (ctx *Context) ExecAsync(in Interpreter) error
func (*Context) GetContracts ¶
func (*Context) InitForTest ¶
func (ctx *Context) InitForTest()
func (*Context) InterpreterId ¶
func (*Context) InterpreterName ¶
func (*Context) SetActionResult ¶
func (*Context) SetCreatorForTest ¶
type ContractApi ¶
type ContractApi struct {
// contains filtered or unexported fields
}
func (*ContractApi) Create ¶
func (self *ContractApi) Create(creator string, code string) (addr types.Address)
func (*ContractApi) Creator ¶
func (self *ContractApi) Creator() types.Address
func (*ContractApi) EmitEvent ¶
func (self *ContractApi) EmitEvent(topics []string, data [][]byte)
type CryptoApi ¶
type CryptoApi struct {
// contains filtered or unexported fields
}
func (*CryptoApi) Recover ¶
Recover recovers public key through signature and msg data. var testAddrHex = "970e8128ab834e8eac17ab8e3812f010678cf791" var testPrivHex = "289c2857d4598e37fb9647507e47a309d6133539bf21a8b9cb6df88fd5232032" key, _ := crypto.HexToECDSA(testPrivHex) msg := crypto.Keccak256([]byte("foo")) sig, err := crypto.Sign(msg, key)
type DatabaseApi ¶
type DatabaseApi struct {
// contains filtered or unexported fields
}
func (*DatabaseApi) Emplace ¶
func (self *DatabaseApi) Emplace(key []byte, val []byte)
func (*DatabaseApi) Erase ¶
func (self *DatabaseApi) Erase(key []byte)
func (*DatabaseApi) Find ¶
func (self *DatabaseApi) Find(key []byte) []byte
func (*DatabaseApi) Get ¶
func (self *DatabaseApi) Get(key []byte) []byte
func (*DatabaseApi) Modify ¶
func (self *DatabaseApi) Modify(key []byte, val []byte)
func (*DatabaseApi) Set ¶
func (self *DatabaseApi) Set(key []byte, val []byte)
type Interpreter ¶
type ProducerApi ¶
type ProducerApi struct {
// contains filtered or unexported fields
}
func (*ProducerApi) Producer ¶
func (self *ProducerApi) Producer() types.Address
type ResultApi ¶
type ResultApi struct {
// contains filtered or unexported fields
}
func (*ResultApi) SetActionResult ¶
type SystemApi ¶
type SystemApi struct {
// contains filtered or unexported fields
}
func (*SystemApi) BytesToInt ¶
func (*SystemApi) GetBlockMiner ¶
func (*SystemApi) GetBlockNumber ¶
func (*SystemApi) IntToBytes ¶
Click to show internal directories.
Click to hide internal directories.