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
- func (a *AccountLock) GetCurrentEpoch() uint32
- func (a *AccountLock) GetProfileList(state *state.State) (result *ProfileList)
- func (a *AccountLock) IsExclusiveAccount(addr meter.Address, state *state.State) bool
- func (a *AccountLock) PrepareAccountLockHandler() (...)
- func (a *AccountLock) SetProfileList(lockList *ProfileList, state *state.State)
- func (a *AccountLock) Start() error
- type AccountLockBody
- func (a *AccountLockBody) GetOpName(op uint32) string
- func (ab *AccountLockBody) GoverningHandler(env *AccountLockEnviroment, gas uint64) (ret []byte, leftOverGas uint64, err error)
- func (ab *AccountLockBody) HandleAccountLockAdd(env *AccountLockEnviroment, gas uint64) (ret []byte, leftOverGas uint64, err error)
- func (ab *AccountLockBody) HandleAccountLockRemove(env *AccountLockEnviroment, gas uint64) (ret []byte, leftOverGas uint64, err error)
- func (ab *AccountLockBody) HandleAccountLockTransfer(env *AccountLockEnviroment, gas uint64) (ret []byte, leftOverGas uint64, err error)
- func (a *AccountLockBody) ToString() string
- 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 ¶
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)
Candidate List
func (*AccountLock) IsExclusiveAccount ¶
func (*AccountLock) PrepareAccountLockHandler ¶
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) (ret []byte, leftOverGas uint64, err error)
func (*AccountLockBody) HandleAccountLockAdd ¶
func (ab *AccountLockBody) HandleAccountLockAdd(env *AccountLockEnviroment, gas uint64) (ret []byte, leftOverGas uint64, err error)
func (*AccountLockBody) HandleAccountLockRemove ¶
func (ab *AccountLockBody) HandleAccountLockRemove(env *AccountLockEnviroment, gas uint64) (ret []byte, leftOverGas uint64, err error)
func (*AccountLockBody) HandleAccountLockTransfer ¶
func (ab *AccountLockBody) HandleAccountLockTransfer(env *AccountLockEnviroment, gas uint64) (ret []byte, leftOverGas uint64, err error)
func (*AccountLockBody) ToString ¶
func (a *AccountLockBody) ToString() string
type AccountLockEnviroment ¶
type AccountLockEnviroment struct {
AccountLock *AccountLock
// contains filtered or unexported fields
}
func NewAccountLockEnviroment ¶
func NewAccountLockEnviroment(AccountLock *AccountLock, state *state.State, txCtx *xenv.TransactionContext, to *meter.Address) *AccountLockEnviroment
func (*AccountLockEnviroment) GetAccountLock ¶
func (env *AccountLockEnviroment) GetAccountLock() *AccountLock
func (*AccountLockEnviroment) GetState ¶
func (env *AccountLockEnviroment) GetState() *state.State
func (*AccountLockEnviroment) GetToAddr ¶
func (env *AccountLockEnviroment) GetToAddr() *meter.Address
func (*AccountLockEnviroment) GetTxCtx ¶
func (env *AccountLockEnviroment) GetTxCtx() *xenv.TransactionContext
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.