accountlock

package
v1.2.0-fork7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2023 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OP_ADDLOCK    = uint32(1)
	OP_REMOVELOCK = uint32(2)
	OP_TRANSFER   = uint32(3)
	OP_GOVERNING  = uint32(100)
)

Variables

This section is empty.

Functions

func RestrictByAccountLock

func RestrictByAccountLock(addr meter.Address, state *state.State) (bool, *big.Int, *big.Int)

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) GoverningHandler

func (a *AccountLock) GoverningHandler(env *setypes.ScriptEnv, ab *AccountLockBody, gas uint64) (leftOverGas uint64, err error)

func (*AccountLock) Handle

func (a *AccountLock) Handle(senv *setypes.ScriptEnv, payload []byte, to *meter.Address, gas uint64) (seOutput *setypes.ScriptEngineOutput, leftOverGas uint64, err error)

func (*AccountLock) HandleAccountLockAdd

func (a *AccountLock) HandleAccountLockAdd(env *setypes.ScriptEnv, ab *AccountLockBody, gas uint64) (leftOverGas uint64, err error)

func (*AccountLock) HandleAccountLockRemove

func (a *AccountLock) HandleAccountLockRemove(env *setypes.ScriptEnv, ab *AccountLockBody, gas uint64) (leftOverGas uint64, err error)

func (*AccountLock) HandleAccountLockTransfer

func (a *AccountLock) HandleAccountLockTransfer(env *setypes.ScriptEnv, ab *AccountLockBody, gas uint64) (leftOverGas uint64, err 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 DecodeFromBytes

func DecodeFromBytes(bytes []byte) (*AccountLockBody, error)

func (*AccountLockBody) GetOpName

func (a *AccountLockBody) GetOpName(op uint32) string

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL