staking

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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