staking

package
v0.0.0-...-680381e Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// staking contract address
	AddrStakingContract = types.StringToAddress("1001")

	ErrMethodNotFoundInABI = errors.New("method not found in ABI")
	ErrFailedTypeAssertion = errors.New("failed type assertion")
)

Functions

func DecodeValidators

func DecodeValidators(method *abi.Method, returnValue []byte) ([]types.Address, error)

DecodeValidators parses contract call result and returns array of address

func QueryBLSPublicKeys

func QueryBLSPublicKeys(t TxQueryHandler, from types.Address) ([][]byte, error)

QueryBLSPublicKeys is a helper function to get BLS Public Keys from contract

func QueryValidators

func QueryValidators(t TxQueryHandler, from types.Address) ([]types.Address, error)

QueryValidators is a helper function to get validator addresses from contract

Types

type TxQueryHandler

type TxQueryHandler interface {
	Apply(*types.Transaction) (*runtime.ExecutionResult, error)
	GetNonce(types.Address) uint64
}

TxQueryHandler is a interface to call view method in the contract

Jump to

Keyboard shortcuts

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