Documentation ¶
Index ¶
- Constants
- func CheckMethod(obj SystemScore) error
- func InstallChainSCORE(addr []byte, cid string, from module.Address, param []byte, cc CallContext, ...) error
- func Invoke(score SystemScore, method string, paramObj *codec.TypedObj) (status error, result *codec.TypedObj, steps *big.Int)
- func NewContext(wc state.WorldContext, cm ContractManager, eem eeproxy.Manager, ...) *context
- func NewFrame(p *callFrame, h ContractHandler, l *big.Int, q bool) *callFrame
- func RoundLimitFactorToRound(validator int, factor int64) int64
- type AcceptHandler
- type AsyncContractHandler
- type CallContext
- type CallHandler
- func (h *CallHandler) DeleteValue(key []byte) ([]byte, error)
- func (h *CallHandler) Dispose()
- func (h *CallHandler) EEType() state.EEType
- func (h *CallHandler) ExecuteAsync(cc CallContext) (err error)
- func (h *CallHandler) GetBalance(addr module.Address) *big.Int
- func (h *CallHandler) GetInfo() *codec.TypedObj
- func (h *CallHandler) GetObjGraph(flags bool) (int, []byte, []byte, error)
- func (h *CallHandler) GetValue(key []byte) ([]byte, error)
- func (h *CallHandler) OnAPI(status error, info *scoreapi.Info)
- func (h *CallHandler) OnCall(from, to module.Address, value, limit *big.Int, method string, ...)
- func (h *CallHandler) OnEvent(addr module.Address, indexed, data [][]byte)
- func (h *CallHandler) OnResult(status error, steps *big.Int, result *codec.TypedObj)
- func (h *CallHandler) Prepare(ctx Context) (state.WorldContext, error)
- func (h *CallHandler) SendResult(status error, steps *big.Int, result *codec.TypedObj) error
- func (h *CallHandler) SetCode(code []byte) error
- func (h *CallHandler) SetObjGraph(flags bool, nextHash int, objGraph []byte) error
- func (h *CallHandler) SetValue(key []byte, value []byte) ([]byte, error)
- type ChainScore
- func (s *ChainScore) Ex_acceptScore(txHash []byte) error
- func (s *ChainScore) Ex_addDeployer(address module.Address) error
- func (s *ChainScore) Ex_addLicense(contentId string) error
- func (s *ChainScore) Ex_addMember(address module.Address) error
- func (s *ChainScore) Ex_blockScore(address module.Address) error
- func (s *ChainScore) Ex_disableScore(address module.Address) error
- func (s *ChainScore) Ex_enableScore(address module.Address) error
- func (s *ChainScore) Ex_getDeployers() ([]interface{}, error)
- func (s *ChainScore) Ex_getMaxStepLimit(contextType string) (int64, error)
- func (s *ChainScore) Ex_getMembers() ([]interface{}, error)
- func (s *ChainScore) Ex_getMinimizeBlockGen() (bool, error)
- func (s *ChainScore) Ex_getRevision() (int64, error)
- func (s *ChainScore) Ex_getRoundLimitFactor() (int64, error)
- func (s *ChainScore) Ex_getScoreStatus(address module.Address) (map[string]interface{}, error)
- func (s *ChainScore) Ex_getServiceConfig() (int64, error)
- func (s *ChainScore) Ex_getStepCost(t string) (int64, error)
- func (s *ChainScore) Ex_getStepCosts() (map[string]interface{}, error)
- func (s *ChainScore) Ex_getStepPrice() (int64, error)
- func (s *ChainScore) Ex_getTimestampThreshold() (int64, error)
- func (s *ChainScore) Ex_getValidators() ([]interface{}, error)
- func (s *ChainScore) Ex_grantValidator(address module.Address) error
- func (s *ChainScore) Ex_isDeployer(address module.Address) (int, error)
- func (s *ChainScore) Ex_rejectScore(txHash []byte) error
- func (s *ChainScore) Ex_removeDeployer(address module.Address) error
- func (s *ChainScore) Ex_removeLicense(contentId string) error
- func (s *ChainScore) Ex_removeMember(address module.Address) error
- func (s *ChainScore) Ex_revokeValidator(address module.Address) error
- func (s *ChainScore) Ex_setDeployerWhiteListEnabled(yn bool) error
- func (s *ChainScore) Ex_setMaxStepLimit(contextType string, cost *common.HexInt) error
- func (s *ChainScore) Ex_setMinimizeBlockGen(b bool) error
- func (s *ChainScore) Ex_setRevision(code *common.HexInt) error
- func (s *ChainScore) Ex_setRoundLimitFactor(f *common.HexInt) error
- func (s *ChainScore) Ex_setStepCost(costType string, cost *common.HexInt) error
- func (s *ChainScore) Ex_setStepPrice(price *common.HexInt) error
- func (s *ChainScore) Ex_setTimestampThreshold(threshold *common.HexInt) error
- func (s *ChainScore) Ex_unblockScore(address module.Address) error
- func (s *ChainScore) GetAPI() *scoreapi.Info
- func (s *ChainScore) Install(param []byte) error
- func (s *ChainScore) Update(param []byte) error
- type CommonHandler
- type Context
- type ContractHandler
- type ContractManager
- type ContractStore
- type DataCallJSON
- type DeployData
- type DeployHandler
- type Patch
- type SyncContractHandler
- type SystemScore
- type SystemScoreModule
- type TransferAndCallHandler
- type TransferAndMessageHandler
- type TransferHandler
Constants ¶
View Source
const ( StatusIllegalArgument = module.StatusReverted + iota StatusNotFound )
View Source
const ( CTypeNone = iota CTypeTransfer CTypeDeploy CTypeCall CTypePatch )
View Source
const ( PreparingContractError = iota + errors.CodeService + 200 NoAvailableProxy )
View Source
const (
CID_CHAIN = "CID_CHAINSCORE"
)
View Source
const (
FUNC_PREFIX = "Ex_"
)
Variables ¶
This section is empty.
Functions ¶
func CheckMethod ¶
func CheckMethod(obj SystemScore) error
func InstallChainSCORE ¶
func NewContext ¶
func RoundLimitFactorToRound ¶
Types ¶
type AcceptHandler ¶
type AcceptHandler struct { *CommonHandler // contains filtered or unexported fields }
func (*AcceptHandler) ExecuteSync ¶
func (h *AcceptHandler) ExecuteSync(cc CallContext) (error, *codec.TypedObj, module.Address)
func (*AcceptHandler) Prepare ¶
func (h *AcceptHandler) Prepare(ctx Context) (state.WorldContext, error)
It's never called
type AsyncContractHandler ¶
type AsyncContractHandler interface { ContractHandler ExecuteAsync(cc CallContext) error SendResult(status error, steps *big.Int, result *codec.TypedObj) error Dispose() EEType() state.EEType eeproxy.CallContext }
type CallContext ¶
type CallContext interface { Context QueryMode() bool Call(handler ContractHandler, limit *big.Int) (error, *big.Int, *codec.TypedObj, module.Address) OnResult(status error, stepUsed *big.Int, result *codec.TypedObj, addr module.Address) OnCall(handler ContractHandler, limit *big.Int) OnEvent(addr module.Address, indexed, data [][]byte) GetBalance(module.Address) *big.Int ReserveExecutor() error GetProxy(eeType state.EEType) eeproxy.Proxy Dispose() StepUsed() *big.Int StepAvailable() *big.Int ApplySteps(t state.StepType, n int) bool DeductSteps(s *big.Int) bool ResetStepLimit(s *big.Int) GetEventLogs(r txresult.Receipt) EnterQueryMode() SetCodeID(code string) GetLastEIDOf(code string) int NewExecution() int GetReturnEID() int }
func NewCallContext ¶
func NewCallContext(ctx Context, limit *big.Int, isQuery bool) CallContext
type CallHandler ¶
type CallHandler struct { *CommonHandler // contains filtered or unexported fields }
func (*CallHandler) DeleteValue ¶
func (h *CallHandler) DeleteValue(key []byte) ([]byte, error)
func (*CallHandler) Dispose ¶
func (h *CallHandler) Dispose()
func (*CallHandler) EEType ¶
func (h *CallHandler) EEType() state.EEType
func (*CallHandler) ExecuteAsync ¶
func (h *CallHandler) ExecuteAsync(cc CallContext) (err error)
func (*CallHandler) GetBalance ¶
func (h *CallHandler) GetBalance(addr module.Address) *big.Int
func (*CallHandler) GetInfo ¶
func (h *CallHandler) GetInfo() *codec.TypedObj
func (*CallHandler) GetObjGraph ¶
func (*CallHandler) OnEvent ¶
func (h *CallHandler) OnEvent(addr module.Address, indexed, data [][]byte)
func (*CallHandler) Prepare ¶
func (h *CallHandler) Prepare(ctx Context) (state.WorldContext, error)
func (*CallHandler) SendResult ¶
func (*CallHandler) SetCode ¶
func (h *CallHandler) SetCode(code []byte) error
func (*CallHandler) SetObjGraph ¶
func (h *CallHandler) SetObjGraph(flags bool, nextHash int, objGraph []byte) error
type ChainScore ¶
type ChainScore struct {
// contains filtered or unexported fields
}
func (*ChainScore) Ex_acceptScore ¶
func (s *ChainScore) Ex_acceptScore(txHash []byte) error
func (*ChainScore) Ex_addDeployer ¶
func (s *ChainScore) Ex_addDeployer(address module.Address) error
func (*ChainScore) Ex_addLicense ¶
func (s *ChainScore) Ex_addLicense(contentId string) error
func (*ChainScore) Ex_addMember ¶
func (s *ChainScore) Ex_addMember(address module.Address) error
func (*ChainScore) Ex_blockScore ¶
func (s *ChainScore) Ex_blockScore(address module.Address) error
Governance score would check the verification of the address
func (*ChainScore) Ex_disableScore ¶
func (s *ChainScore) Ex_disableScore(address module.Address) error
Destroy : Allowed from score owner
func (*ChainScore) Ex_enableScore ¶
func (s *ChainScore) Ex_enableScore(address module.Address) error
func (*ChainScore) Ex_getDeployers ¶
func (s *ChainScore) Ex_getDeployers() ([]interface{}, error)
func (*ChainScore) Ex_getMaxStepLimit ¶
func (s *ChainScore) Ex_getMaxStepLimit(contextType string) (int64, error)
func (*ChainScore) Ex_getMembers ¶
func (s *ChainScore) Ex_getMembers() ([]interface{}, error)
func (*ChainScore) Ex_getMinimizeBlockGen ¶
func (s *ChainScore) Ex_getMinimizeBlockGen() (bool, error)
func (*ChainScore) Ex_getRevision ¶
func (s *ChainScore) Ex_getRevision() (int64, error)
User calls icx_call : Functions which can be called by anyone.
func (*ChainScore) Ex_getRoundLimitFactor ¶
func (s *ChainScore) Ex_getRoundLimitFactor() (int64, error)
func (*ChainScore) Ex_getScoreStatus ¶
func (s *ChainScore) Ex_getScoreStatus(address module.Address) (map[string]interface{}, error)
func (*ChainScore) Ex_getServiceConfig ¶
func (s *ChainScore) Ex_getServiceConfig() (int64, error)
func (*ChainScore) Ex_getStepCost ¶
func (s *ChainScore) Ex_getStepCost(t string) (int64, error)
func (*ChainScore) Ex_getStepCosts ¶
func (s *ChainScore) Ex_getStepCosts() (map[string]interface{}, error)
func (*ChainScore) Ex_getStepPrice ¶
func (s *ChainScore) Ex_getStepPrice() (int64, error)
func (*ChainScore) Ex_getTimestampThreshold ¶
func (s *ChainScore) Ex_getTimestampThreshold() (int64, error)
func (*ChainScore) Ex_getValidators ¶
func (s *ChainScore) Ex_getValidators() ([]interface{}, error)
func (*ChainScore) Ex_grantValidator ¶
func (s *ChainScore) Ex_grantValidator(address module.Address) error
func (*ChainScore) Ex_isDeployer ¶
func (s *ChainScore) Ex_isDeployer(address module.Address) (int, error)
func (*ChainScore) Ex_rejectScore ¶
func (s *ChainScore) Ex_rejectScore(txHash []byte) error
func (*ChainScore) Ex_removeDeployer ¶
func (s *ChainScore) Ex_removeDeployer(address module.Address) error
func (*ChainScore) Ex_removeLicense ¶
func (s *ChainScore) Ex_removeLicense(contentId string) error
func (*ChainScore) Ex_removeMember ¶
func (s *ChainScore) Ex_removeMember(address module.Address) error
func (*ChainScore) Ex_revokeValidator ¶
func (s *ChainScore) Ex_revokeValidator(address module.Address) error
func (*ChainScore) Ex_setDeployerWhiteListEnabled ¶
func (s *ChainScore) Ex_setDeployerWhiteListEnabled(yn bool) error
func (*ChainScore) Ex_setMaxStepLimit ¶
func (s *ChainScore) Ex_setMaxStepLimit(contextType string, cost *common.HexInt) error
func (*ChainScore) Ex_setMinimizeBlockGen ¶
func (s *ChainScore) Ex_setMinimizeBlockGen(b bool) error
func (*ChainScore) Ex_setRevision ¶
func (s *ChainScore) Ex_setRevision(code *common.HexInt) error
Governance functions : Functions which can be called by governance SCORE.
func (*ChainScore) Ex_setRoundLimitFactor ¶
func (s *ChainScore) Ex_setRoundLimitFactor(f *common.HexInt) error
func (*ChainScore) Ex_setStepCost ¶
func (s *ChainScore) Ex_setStepCost(costType string, cost *common.HexInt) error
func (*ChainScore) Ex_setStepPrice ¶
func (s *ChainScore) Ex_setStepPrice(price *common.HexInt) error
func (*ChainScore) Ex_setTimestampThreshold ¶
func (s *ChainScore) Ex_setTimestampThreshold(threshold *common.HexInt) error
func (*ChainScore) Ex_unblockScore ¶
func (s *ChainScore) Ex_unblockScore(address module.Address) error
Governance score would check the verification of the address
func (*ChainScore) GetAPI ¶
func (s *ChainScore) GetAPI() *scoreapi.Info
func (*ChainScore) Install ¶
func (s *ChainScore) Install(param []byte) error
func (*ChainScore) Update ¶
func (s *ChainScore) Update(param []byte) error
type CommonHandler ¶
type CommonHandler struct {
// contains filtered or unexported fields
}
func (*CommonHandler) Logger ¶
func (h *CommonHandler) Logger() log.Logger
func (*CommonHandler) Prepare ¶
func (h *CommonHandler) Prepare(ctx Context) (state.WorldContext, error)
func (*CommonHandler) ResetLogger ¶
func (h *CommonHandler) ResetLogger(logger log.Logger)
type Context ¶
type Context interface { state.WorldContext ContractManager() ContractManager EEManager() eeproxy.Manager GetPreInstalledScore(id string) ([]byte, error) Logger() log.Logger PatchDecoder() module.PatchDecoder TraceInfo() *module.TraceInfo ChainID() int }
type ContractHandler ¶
type ContractManager ¶
type ContractManager interface { GetHandler(from, to module.Address, value *big.Int, ctype int, data []byte) (ContractHandler, error) GetCallHandler(from, to module.Address, value *big.Int, method string, paramObj *codec.TypedObj) ContractHandler PrepareContractStore(ws state.WorldState, contract state.Contract) (ContractStore, error) }
func NewContractManager ¶
type ContractStore ¶
type DataCallJSON ¶
type DataCallJSON struct { Method string `json:"method"` Params json.RawMessage `json:"params"` }
func ParseCallData ¶
func ParseCallData(data []byte) (*DataCallJSON, error)
type DeployData ¶
type DeployData struct { ContentType string `json:"contentType"` Content common.HexBytes `json:"content"` Params json.RawMessage `json:"params"` }
func ParseDeployData ¶
func ParseDeployData(data []byte) (*DeployData, error)
type DeployHandler ¶
type DeployHandler struct { *CommonHandler // contains filtered or unexported fields }
func NewDeployHandlerForPreInstall ¶
func NewDeployHandlerForPreInstall(owner, scoreAddr module.Address, contentType string, content []byte, params *json.RawMessage, log log.Logger, ) *DeployHandler
func (*DeployHandler) ExecuteSync ¶
func (h *DeployHandler) ExecuteSync(cc CallContext) (error, *codec.TypedObj, module.Address)
func (*DeployHandler) Prepare ¶
func (h *DeployHandler) Prepare(ctx Context) (state.WorldContext, error)
type Patch ¶
func ParsePatchData ¶
type SyncContractHandler ¶
type SyncContractHandler interface { ContractHandler ExecuteSync(cc CallContext) (error, *codec.TypedObj, module.Address) }
type SystemScore ¶
type SystemScore interface { Install(param []byte) error Update(param []byte) error GetAPI() *scoreapi.Info }
func GetSystemScore ¶
func GetSystemScore(contentID string, cc CallContext, from module.Address) (score SystemScore, err error)
func NewChainScore ¶
func NewChainScore(cid string, cc CallContext, from module.Address) (SystemScore, error)
type SystemScoreModule ¶
type SystemScoreModule struct {
New func(cid string, cc CallContext, from module.Address) (SystemScore, error)
}
type TransferAndCallHandler ¶
type TransferAndCallHandler struct { *CallHandler // contains filtered or unexported fields }
func (*TransferAndCallHandler) ExecuteAsync ¶
func (h *TransferAndCallHandler) ExecuteAsync(cc CallContext) error
func (*TransferAndCallHandler) Prepare ¶
func (h *TransferAndCallHandler) Prepare(ctx Context) (state.WorldContext, error)
type TransferAndMessageHandler ¶
type TransferAndMessageHandler struct { *TransferHandler // contains filtered or unexported fields }
type TransferHandler ¶
type TransferHandler struct {
*CommonHandler
}
func (*TransferHandler) ExecuteSync ¶
func (h *TransferHandler) ExecuteSync(cc CallContext) (error, *codec.TypedObj, module.Address)
Click to show internal directories.
Click to hide internal directories.