carrier

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Carrier

type Carrier interface {
	// BlockTimestamp returns the timestamp of a block
	BlockTimestamp(uint64) (time.Time, error)
	// SubscribeNewBlock callbacks on new block created
	SubscribeNewBlock(chan uint64, chan error, chan bool)
	// TipHeight returns the latest height
	TipHeight() (uint64, error)
	// Candidates returns the candidates on height
	Candidates(uint64, *big.Int, uint8) (*big.Int, []*types.Candidate, error)
	// Votes returns the votes on height
	Votes(uint64, *big.Int, uint8) (*big.Int, []*types.Vote, error)
	// Close closes carrier
	Close()
}

Carrier defines an interfact to fetch votes

func NewEthereumVoteCarrier

func NewEthereumVoteCarrier(
	clientURLs []string,
	registerContractAddress common.Address,
	stakingContractAddress common.Address,
) (Carrier, error)

NewEthereumVoteCarrier defines a carrier to fetch votes from ethereum contract

type EthereumBucketsResult added in v0.1.1

type EthereumBucketsResult struct {
	Count           *big.Int
	Indexes         []*big.Int
	StakeStartTimes []*big.Int
	StakeDurations  []*big.Int
	Decays          []bool
	StakedAmounts   []*big.Int
	CanNames        [][12]byte
	Owners          []common.Address
}

EthereumBucketsResult defines the data structure the buckets api returns

Jump to

Keyboard shortcuts

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