staking

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 7 Imported by: 5

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 added in v0.6.0

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
	SetNonPayable(nonPayable bool)
}

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