energy

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Energy

type Energy struct {
	// contains filtered or unexported fields
}

Energy implements energy operations.

func New

func New(addr thor.Address, state *state.State, blockTime uint64) *Energy

New creates a new energy instance.

func (*Energy) Add

func (e *Energy) Add(addr thor.Address, amount *big.Int) error

Add add amount of energy to given address.

func (*Energy) Get

func (e *Energy) Get(addr thor.Address) (*big.Int, error)

Get returns energy of an account at given block time.

func (*Energy) SetInitialSupply

func (e *Energy) SetInitialSupply(token *big.Int, energy *big.Int) error

SetInitialSupply set initial token and energy supply, to help calculating total energy supply.

func (*Energy) Sub

func (e *Energy) Sub(addr thor.Address, amount *big.Int) (bool, error)

Sub sub amount of energy from given address. False is returned if no enough energy.

func (*Energy) TokenTotalSupply

func (e *Energy) TokenTotalSupply() (*big.Int, error)

TokenTotalSupply returns total supply of VET.

func (*Energy) TotalBurned

func (e *Energy) TotalBurned() (*big.Int, error)

TotalBurned returns energy totally burned.

func (*Energy) TotalSupply

func (e *Energy) TotalSupply() (*big.Int, error)

TotalSupply returns total supply of energy.

Jump to

Keyboard shortcuts

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