energy

package
v0.0.0-...-75aef46 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: GPL-3.0 Imports: 4 Imported by: 1

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 powerplay.Address, state *state.State, blockTime uint64) *Energy

New creates a new energy instance.

func (*Energy) Add

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

Add add amount of energy to given address.

func (*Energy) Get

func (e *Energy) Get(addr powerplay.Address) *big.Int

Get returns energy of an account at given block time.

func (*Energy) SetInitialSupply

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

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

func (*Energy) Sub

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

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

func (*Energy) TokenTotalSupply

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

TokenTotalSupply returns total supply of VET.

func (*Energy) TotalBurned

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

TotalBurned returns energy totally burned.

func (*Energy) TotalSupply

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

TotalSupply returns total supply of energy.

Jump to

Keyboard shortcuts

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