Documentation ¶
Index ¶
- Variables
- type ContractManager
- type ContractManagerRuntime
- func (r *ContractManagerRuntime) FreezeContract(context protocol.TxSimContext, name string) (*commonPb.Contract, error)
- func (r *ContractManagerRuntime) GetAllContracts(context protocol.TxSimContext) ([]*commonPb.Contract, error)
- func (r *ContractManagerRuntime) GetContractByteCode(context protocol.TxSimContext, name string) ([]byte, error)
- func (r *ContractManagerRuntime) GetContractInfo(context protocol.TxSimContext, name string) (*commonPb.Contract, error)
- func (r *ContractManagerRuntime) InstallContract(context protocol.TxSimContext, name, version string, byteCode []byte, ...) (*commonPb.Contract, error)
- func (r *ContractManagerRuntime) RevokeContract(context protocol.TxSimContext, name string) (*commonPb.Contract, error)
- func (r *ContractManagerRuntime) UnfreezeContract(context protocol.TxSimContext, name string) (*commonPb.Contract, error)
- func (r *ContractManagerRuntime) UpgradeContract(context protocol.TxSimContext, name, version string, byteCode []byte, ...) (*commonPb.Contract, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ContractName 当前合约的合约名 ContractName = syscontract.SystemContract_CONTRACT_MANAGE.String() // TRUE bytes true TRUE = []byte("true") // FALSE bytes false FALSE = []byte("false") )
Functions ¶
This section is empty.
Types ¶
type ContractManager ¶
type ContractManager struct {
// contains filtered or unexported fields
}
ContractManager 提供合约安装、升级、冻结、查询等
func NewContractManager ¶
func NewContractManager(log protocol.Logger) *ContractManager
NewContractManager create a new ContractManager instance @param log @return *ContractManager
func (*ContractManager) GetMethod ¶
func (c *ContractManager) GetMethod(methodName string) common.ContractFunc
GetMethod get register method by name
type ContractManagerRuntime ¶
type ContractManagerRuntime struct {
// contains filtered or unexported fields
}
ContractManagerRuntime comment at next version
func (*ContractManagerRuntime) FreezeContract ¶
func (r *ContractManagerRuntime) FreezeContract(context protocol.TxSimContext, name string) ( *commonPb.Contract, error)
FreezeContract comment at next version
func (*ContractManagerRuntime) GetAllContracts ¶
func (r *ContractManagerRuntime) GetAllContracts(context protocol.TxSimContext) ([]*commonPb.Contract, error)
GetAllContracts 查询所有合约的详细信息 返回合约地址和基础信息 @return name 合约名称 @return Version 版本 @return RuntimeType 运行时类型 @return Status 状态一般是0 @return Creator 创建合约的人 @return Address 合约地址
func (*ContractManagerRuntime) GetContractByteCode ¶
func (r *ContractManagerRuntime) GetContractByteCode(context protocol.TxSimContext, name string) ([]byte, error)
GetContractByteCode comment at next version
func (*ContractManagerRuntime) GetContractInfo ¶
func (r *ContractManagerRuntime) GetContractInfo(context protocol.TxSimContext, name string) (*commonPb.Contract, error)
GetContractInfo 根据合约名字查询合约的详细信息 返回合约地址和基础信息 @return name 合约名称 @return Version 版本 @return RuntimeType 运行时类型 @return Status 状态一般是0 @return Creator 创建合约的人 @return Address 合约地址
func (*ContractManagerRuntime) InstallContract ¶
func (r *ContractManagerRuntime) InstallContract(context protocol.TxSimContext, name, version string, byteCode []byte, runTime commonPb.RuntimeType, initParameters map[string][]byte) (*commonPb.Contract, error)
InstallContract 安装新合约
func (*ContractManagerRuntime) RevokeContract ¶
func (r *ContractManagerRuntime) RevokeContract(context protocol.TxSimContext, name string) ( *commonPb.Contract, error)
RevokeContract comment at next version