Documentation
¶
Index ¶
- Constants
- type AccountManager
- type AccountManagerRuntime
- func (g *AccountManagerRuntime) ChargeGasVm(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (g *AccountManagerRuntime) FrozenAccount(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (g *AccountManagerRuntime) GetAccountStatus(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (g *AccountManagerRuntime) GetAdmin(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (g *AccountManagerRuntime) GetBalance(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (g *AccountManagerRuntime) RechargeGas(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (g *AccountManagerRuntime) RefundGas(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (g *AccountManagerRuntime) RefundGasVm(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (g *AccountManagerRuntime) SetAdmin(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (g *AccountManagerRuntime) UnFrozenAccount(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- type AccountMgr
Constants ¶
View Source
const ( AccountPrefix = "__account_prefix__" FrozenPrefix = "__frozen_account__" AddressKey = "address_key" BatchRecharge = "batch_recharge" RechargeKey = "recharge_key" RechargeAmountKey = "recharge_amount_key" ChargePublicKey = "charge_public_key" ChargeGasAmount = "charge_gas_amount" Success = "success" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountManager ¶
type AccountManager struct {
// contains filtered or unexported fields
}
func NewAccountManager ¶
func NewAccountManager(log protocol.Logger) *AccountManager
func (*AccountManager) GetMethod ¶
func (g *AccountManager) GetMethod(methodName string) common.ContractFunc
type AccountManagerRuntime ¶
type AccountManagerRuntime struct {
// contains filtered or unexported fields
}
func (*AccountManagerRuntime) ChargeGasVm ¶
func (g *AccountManagerRuntime) ChargeGasVm(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
charge gas for vm and must set config auth multi sign
func (*AccountManagerRuntime) FrozenAccount ¶
func (g *AccountManagerRuntime) FrozenAccount(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
func (*AccountManagerRuntime) GetAccountStatus ¶
func (g *AccountManagerRuntime) GetAccountStatus(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
func (*AccountManagerRuntime) GetAdmin ¶
func (g *AccountManagerRuntime) GetAdmin(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
func (*AccountManagerRuntime) GetBalance ¶
func (g *AccountManagerRuntime) GetBalance(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
func (*AccountManagerRuntime) RechargeGas ¶
func (g *AccountManagerRuntime) RechargeGas(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
func (*AccountManagerRuntime) RefundGas ¶
func (g *AccountManagerRuntime) RefundGas(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
refund gas for sdk
func (*AccountManagerRuntime) RefundGasVm ¶
func (g *AccountManagerRuntime) RefundGasVm(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
func (*AccountManagerRuntime) SetAdmin ¶
func (g *AccountManagerRuntime) SetAdmin(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
func (*AccountManagerRuntime) UnFrozenAccount ¶
func (g *AccountManagerRuntime) UnFrozenAccount(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
type AccountMgr ¶
type AccountMgr interface {
/**
* @Description: 设置gas管理员
* @param publicKey
* @return bool
* @return error
*/
SetAdmin(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
/**
* @Description: 查询gas管理员
* @param publicKey
* @return []byte
* @return error
*/
GetAdmin(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
/**
* @Description: 充值gas
* @param publicKey
* @param gas
* @return bool
* @return error
*/
RechargeGas(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
/**
* @Description: 扣款for vm
* @param publicKey
* @param gas
* @return bool
* @return error
*/
ChargeGasVm(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
/**
* @Description: 退还多扣的gas for vm
* @param: publicKey 发起交易的账户公钥
* @param: gas 退还gas数量
* @return bool 是否退还成功
* @return error
*/
RefundGasVm(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
/**
* @Description: 查询gas余额
* @param publicKey
* @return uint64
* @return error
*/
GetBalance(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
/**
* @Description: 退款for sdk
* @param publicKey
* @param gasUsed
* @return bool
* @return error
*/
RefundGas(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
/**
* @Description: 冻结指定账户
* @param publicKey
* @return bool
* @return error
*/
FrozenAccount(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
/**
* @Description: 解冻指定账号
* @param txSimContext
* @param params
* @return []byte
* @return error
*/
UnFrozenAccount(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
/**
* @Description: 获取账户冻结状态
* @param publicKey
* @return bool
* @return error
*/
GetAccountStatus(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
}
Click to show internal directories.
Click to hide internal directories.