Documentation ¶
Index ¶
- Constants
- Variables
- func AccountLockEncodeBytes(sb *AccountLockBody) []byte
- func RestrictByAccountLock(addr meter.Address, state *state.State) (bool, *big.Int, *big.Int)
- func SetAccountLockGlobInst(inst *AccountLock)
- type AccountLock
- type AccountLockBody
- func (a *AccountLockBody) GetOpName(op uint32) string
- func (ab *AccountLockBody) GoverningHandler(env *AccountLockEnviroment, gas uint64) (leftOverGas uint64, err error)
- func (ab *AccountLockBody) HandleAccountLockAdd(env *AccountLockEnviroment, gas uint64) (leftOverGas uint64, err error)
- func (ab *AccountLockBody) HandleAccountLockRemove(env *AccountLockEnviroment, gas uint64) (leftOverGas uint64, err error)
- func (ab *AccountLockBody) HandleAccountLockTransfer(env *AccountLockEnviroment, gas uint64) (leftOverGas uint64, err error)
- func (sb *AccountLockBody) String() string
- func (a *AccountLockBody) ToString() string
- func (sb *AccountLockBody) UniteHash() (hash meter.Bytes32)
- type AccountLockEnviroment
- type Profile
- type ProfileList
- func (cl *ProfileList) Add(c *Profile)
- func (cl *ProfileList) Count() int
- func (cl *ProfileList) Exist(addr meter.Address) bool
- func (cl *ProfileList) Get(addr meter.Address) *Profile
- func (cl *ProfileList) Remove(addr meter.Address)
- func (l *ProfileList) ToList() []Profile
- func (cl *ProfileList) ToString() string
Constants ¶
View Source
const ( OP_ADDLOCK = uint32(1) OP_REMOVELOCK = uint32(2) OP_TRANSFER = uint32(3) OP_GOVERNING = uint32(100) )
Variables ¶
View Source
var ( //0x6163636f756e742d6c6f636b2d61646472657373 AccountLockAddr = meter.BytesToAddress([]byte("account-lock-address")) AccountLockProfileKey = meter.Blake2b([]byte("account-lock-profile-list-key")) )
the global variables in AccountLock
Functions ¶
func AccountLockEncodeBytes ¶
func AccountLockEncodeBytes(sb *AccountLockBody) []byte
func RestrictByAccountLock ¶
func SetAccountLockGlobInst ¶
func SetAccountLockGlobInst(inst *AccountLock)
Types ¶
type AccountLock ¶
type AccountLock struct {
// contains filtered or unexported fields
}
Candidate indicates the structure of a candidate
var (
AccountLockGlobInst *AccountLock
)
func GetAccountLockGlobInst ¶
func GetAccountLockGlobInst() *AccountLock
func NewAccountLock ¶
func NewAccountLock(ch *chain.Chain, sc *state.Creator) *AccountLock
func (*AccountLock) GetCurrentEpoch ¶
func (a *AccountLock) GetCurrentEpoch() uint32
func (*AccountLock) GetProfileList ¶
func (a *AccountLock) GetProfileList(state *state.State) (result *ProfileList)
Profile List
func (*AccountLock) PrepareAccountLockHandler ¶
func (a *AccountLock) PrepareAccountLockHandler() (AccountLockHandler func([]byte, *meter.Address, *xenv.TransactionContext, uint64, *state.State) (*setypes.ScriptEngineOutput, uint64, error))
func (*AccountLock) SetProfileList ¶
func (a *AccountLock) SetProfileList(lockList *ProfileList, state *state.State)
func (*AccountLock) Start ¶
func (a *AccountLock) Start() error
type AccountLockBody ¶
type AccountLockBody struct { Opcode uint32 Version uint32 Option uint32 LockEpoch uint32 ReleaseEpoch uint32 FromAddr meter.Address ToAddr meter.Address MeterAmount *big.Int MeterGovAmount *big.Int Memo []byte }
Candidate indicates the structure of a candidate
func AccountLockDecodeFromBytes ¶
func AccountLockDecodeFromBytes(bytes []byte) (*AccountLockBody, error)
func (*AccountLockBody) GetOpName ¶
func (a *AccountLockBody) GetOpName(op uint32) string
func (*AccountLockBody) GoverningHandler ¶
func (ab *AccountLockBody) GoverningHandler(env *AccountLockEnviroment, gas uint64) (leftOverGas uint64, err error)
func (*AccountLockBody) HandleAccountLockAdd ¶
func (ab *AccountLockBody) HandleAccountLockAdd(env *AccountLockEnviroment, gas uint64) (leftOverGas uint64, err error)
func (*AccountLockBody) HandleAccountLockRemove ¶
func (ab *AccountLockBody) HandleAccountLockRemove(env *AccountLockEnviroment, gas uint64) (leftOverGas uint64, err error)
func (*AccountLockBody) HandleAccountLockTransfer ¶
func (ab *AccountLockBody) HandleAccountLockTransfer(env *AccountLockEnviroment, gas uint64) (leftOverGas uint64, err error)
func (*AccountLockBody) String ¶ added in v1.2.0
func (sb *AccountLockBody) String() string
func (*AccountLockBody) ToString ¶
func (a *AccountLockBody) ToString() string
func (*AccountLockBody) UniteHash ¶ added in v1.2.0
func (sb *AccountLockBody) UniteHash() (hash meter.Bytes32)
type AccountLockEnviroment ¶
func NewAccountLockEnviroment ¶
func NewAccountLockEnviroment(accountLock *AccountLock, state *state.State, txCtx *xenv.TransactionContext, to *meter.Address) *AccountLockEnviroment
func (*AccountLockEnviroment) GetAccountLock ¶
func (env *AccountLockEnviroment) GetAccountLock() *AccountLock
type Profile ¶
type Profile struct { Addr meter.Address Memo []byte LockEpoch uint32 ReleaseEpoch uint32 MeterAmount *big.Int MeterGovAmount *big.Int }
Profile indicates the structure of a Profile
func NewProfile ¶
type ProfileList ¶
type ProfileList struct {
Profiles []*Profile
}
func NewProfileList ¶
func NewProfileList(Profiles []*Profile) *ProfileList
func (*ProfileList) Add ¶
func (cl *ProfileList) Add(c *Profile)
func (*ProfileList) Count ¶
func (cl *ProfileList) Count() int
func (*ProfileList) Remove ¶
func (cl *ProfileList) Remove(addr meter.Address)
func (*ProfileList) ToList ¶
func (l *ProfileList) ToList() []Profile
func (*ProfileList) ToString ¶
func (cl *ProfileList) ToString() string
Click to show internal directories.
Click to hide internal directories.