poll

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 41 Imported by: 11

Documentation

Index

Constants

View Source
const ConsortiumManagementABI = "" /* 4956-byte string literal not displayed */

ConsortiumManagementABI is the input ABI used to generate the binding from.

Variables

View Source
var (
	// CandidateNamespace is a namespace to store raw candidate
	CandidateNamespace = "candidates"
	// ProbationNamespace is a namespace to store probationlist
	ProbationNamespace = "kickout"
	// ErrIndexerNotExist is an error that shows not exist in candidate indexer DB
	ErrIndexerNotExist = errors.New("not exist in DB")
)
View Source
var (
	// ErrNoData is an error that there's no data in the contract
	ErrNoData = errors.New("no data")
	// ErrEndOfData is an error that reaching end of data in the contract
	ErrEndOfData = errors.New("end of data")
)
View Source
var ErrDelegatesNotAsExpected = errors.New("delegates are not as expected")

ErrDelegatesNotAsExpected is an error that the delegates are not as expected

View Source
var ErrDelegatesNotExist = errors.New("delegates cannot be found")

ErrDelegatesNotExist is an error that the delegates cannot be prepared

View Source
var ErrInconsistentHeight = errors.New("data is inconsistent because the state height has been changed")

ErrInconsistentHeight is an error that result of "readFromStateDB" is not consistent with others

View Source
var ErrNoElectionCommittee = errors.New("no election committee specified")

ErrNoElectionCommittee is an error that the election committee is not specified

View Source
var ErrProposedDelegatesLength = errors.New("the proposed delegate list length")

ErrProposedDelegatesLength is an error that the proposed delegate list length is not right

View Source
var NsAbi = `` /* 12350-byte string literal not displayed */

NsAbi is the ABI of native staking contract

Functions

This section is empty.

Types

type CandidateIndexer added in v0.11.0

type CandidateIndexer struct {
	// contains filtered or unexported fields
}

CandidateIndexer is an indexer to store candidate/probationList by given height

func NewCandidateIndexer added in v0.11.0

func NewCandidateIndexer(kv db.KVStore) (*CandidateIndexer, error)

NewCandidateIndexer creates a new CandidateIndexer

func (*CandidateIndexer) CandidateList added in v0.11.0

func (cd *CandidateIndexer) CandidateList(height uint64) (state.CandidateList, error)

CandidateList gets candidate list from indexer given epoch start height

func (*CandidateIndexer) ProbationList added in v1.0.0

func (cd *CandidateIndexer) ProbationList(height uint64) (*vote.ProbationList, error)

ProbationList gets probation list from indexer given epoch start height

func (*CandidateIndexer) PutCandidateList added in v0.11.0

func (cd *CandidateIndexer) PutCandidateList(height uint64, candidates *state.CandidateList) error

PutCandidateList puts candidate list into indexer

func (*CandidateIndexer) PutProbationList added in v1.0.0

func (cd *CandidateIndexer) PutProbationList(height uint64, probationList *vote.ProbationList) error

PutProbationList puts probation list into indexer

func (*CandidateIndexer) Start added in v0.11.0

func (cd *CandidateIndexer) Start(ctx context.Context) error

Start starts the indexer

func (*CandidateIndexer) Stop added in v0.11.0

func (cd *CandidateIndexer) Stop(ctx context.Context) error

Stop stops the indexer

type ConsortiumManagement added in v1.0.0

type ConsortiumManagement struct {
	ConsortiumManagementCaller     // Read-only binding to the contract
	ConsortiumManagementTransactor // Write-only binding to the contract
	ConsortiumManagementFilterer   // Log filterer for contract events
}

ConsortiumManagement is an auto generated Go binding around an Ethereum contract.

func NewConsortiumManagement added in v1.0.0

func NewConsortiumManagement(address common.Address, backend bind.ContractBackend) (*ConsortiumManagement, error)

NewConsortiumManagement creates a new instance of ConsortiumManagement, bound to a specific deployed contract.

type ConsortiumManagementAddOperator added in v1.0.0

type ConsortiumManagementAddOperator struct {
	Member   common.Address
	Operator common.Address
	Endpoint string
	Raw      types.Log // Blockchain specific contextual infos
}

ConsortiumManagementAddOperator represents a AddOperator event raised by the ConsortiumManagement contract.

type ConsortiumManagementAddOperatorIterator added in v1.0.0

type ConsortiumManagementAddOperatorIterator struct {
	Event *ConsortiumManagementAddOperator // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

ConsortiumManagementAddOperatorIterator is returned from FilterAddOperator and is used to iterate over the raw logs and unpacked data for AddOperator events raised by the ConsortiumManagement contract.

func (*ConsortiumManagementAddOperatorIterator) Close added in v1.0.0

Close terminates the iteration process, releasing any pending underlying resources.

func (*ConsortiumManagementAddOperatorIterator) Error added in v1.0.0

Error returns any retrieval or parsing error occurred during filtering.

func (*ConsortiumManagementAddOperatorIterator) Next added in v1.0.0

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type ConsortiumManagementCaller added in v1.0.0

type ConsortiumManagementCaller struct {
	// contains filtered or unexported fields
}

ConsortiumManagementCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewConsortiumManagementCaller added in v1.0.0

func NewConsortiumManagementCaller(address common.Address, caller bind.ContractCaller) (*ConsortiumManagementCaller, error)

NewConsortiumManagementCaller creates a new read-only instance of ConsortiumManagement, bound to a specific deployed contract.

func (*ConsortiumManagementCaller) Delegates added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCaller) Delegates(opts *bind.CallOpts) ([]common.Address, error)

Delegates is a free data retrieval call binding the contract method 0x6138b19e.

Solidity: function delegates() constant returns(address[])

func (*ConsortiumManagementCaller) HealthEndpoint added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCaller) HealthEndpoint(opts *bind.CallOpts, operator common.Address) (string, error)

HealthEndpoint is a free data retrieval call binding the contract method 0xb44d5fc7.

Solidity: function healthEndpoint(address operator) constant returns(string)

func (*ConsortiumManagementCaller) IsMember added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCaller) IsMember(opts *bind.CallOpts, addr common.Address) (bool, error)

IsMember is a free data retrieval call binding the contract method 0xa230c524.

Solidity: function isMember(address addr) constant returns(bool)

func (*ConsortiumManagementCaller) Members added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCaller) Members(opts *bind.CallOpts) ([]common.Address, error)

Members is a free data retrieval call binding the contract method 0xbdd4d18d.

Solidity: function members() constant returns(address[])

func (*ConsortiumManagementCaller) Operators added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCaller) Operators(opts *bind.CallOpts, addr common.Address) ([]common.Address, error)

Operators is a free data retrieval call binding the contract method 0x13e7c9d8.

Solidity: function operators(address addr) constant returns(address[])

func (*ConsortiumManagementCaller) Proposal added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCaller) Proposal(opts *bind.CallOpts) (struct {
	Id          *big.Int
	Proposer    common.Address
	Ptype       uint8
	Member      common.Address
	Capacity    uint8
	Approves    []common.Address
	Disapproves []common.Address
}, error)

Proposal is a free data retrieval call binding the contract method 0x753ec103.

Solidity: function proposal() constant returns(uint256 id, address proposer, uint8 ptype, address member, uint8 capacity, address[] approves, address[] disapproves)

type ConsortiumManagementCallerRaw added in v1.0.0

type ConsortiumManagementCallerRaw struct {
	Contract *ConsortiumManagementCaller // Generic read-only contract binding to access the raw methods on
}

ConsortiumManagementCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*ConsortiumManagementCallerRaw) Call added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type ConsortiumManagementCallerSession added in v1.0.0

type ConsortiumManagementCallerSession struct {
	Contract *ConsortiumManagementCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts               // Call options to use throughout this session
}

ConsortiumManagementCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*ConsortiumManagementCallerSession) Delegates added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCallerSession) Delegates() ([]common.Address, error)

Delegates is a free data retrieval call binding the contract method 0x6138b19e.

Solidity: function delegates() constant returns(address[])

func (*ConsortiumManagementCallerSession) HealthEndpoint added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCallerSession) HealthEndpoint(operator common.Address) (string, error)

HealthEndpoint is a free data retrieval call binding the contract method 0xb44d5fc7.

Solidity: function healthEndpoint(address operator) constant returns(string)

func (*ConsortiumManagementCallerSession) IsMember added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCallerSession) IsMember(addr common.Address) (bool, error)

IsMember is a free data retrieval call binding the contract method 0xa230c524.

Solidity: function isMember(address addr) constant returns(bool)

func (*ConsortiumManagementCallerSession) Members added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCallerSession) Members() ([]common.Address, error)

Members is a free data retrieval call binding the contract method 0xbdd4d18d.

Solidity: function members() constant returns(address[])

func (*ConsortiumManagementCallerSession) Operators added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCallerSession) Operators(addr common.Address) ([]common.Address, error)

Operators is a free data retrieval call binding the contract method 0x13e7c9d8.

Solidity: function operators(address addr) constant returns(address[])

func (*ConsortiumManagementCallerSession) Proposal added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementCallerSession) Proposal() (struct {
	Id          *big.Int
	Proposer    common.Address
	Ptype       uint8
	Member      common.Address
	Capacity    uint8
	Approves    []common.Address
	Disapproves []common.Address
}, error)

Proposal is a free data retrieval call binding the contract method 0x753ec103.

Solidity: function proposal() constant returns(uint256 id, address proposer, uint8 ptype, address member, uint8 capacity, address[] approves, address[] disapproves)

type ConsortiumManagementFilterer added in v1.0.0

type ConsortiumManagementFilterer struct {
	// contains filtered or unexported fields
}

ConsortiumManagementFilterer is an auto generated log filtering Go binding around an Ethereum contract events.

func NewConsortiumManagementFilterer added in v1.0.0

func NewConsortiumManagementFilterer(address common.Address, filterer bind.ContractFilterer) (*ConsortiumManagementFilterer, error)

NewConsortiumManagementFilterer creates a new log filterer instance of ConsortiumManagement, bound to a specific deployed contract.

func (*ConsortiumManagementFilterer) FilterAddOperator added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementFilterer) FilterAddOperator(opts *bind.FilterOpts) (*ConsortiumManagementAddOperatorIterator, error)

FilterAddOperator is a free log retrieval operation binding the contract event 0xc1ad0c93e1873e80f0551582678c47e2e3cd93d9f12f18b1012ed1ad51654d74.

Solidity: event AddOperator(address member, address operator, string endpoint)

func (*ConsortiumManagementFilterer) FilterPropose added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementFilterer) FilterPropose(opts *bind.FilterOpts) (*ConsortiumManagementProposeIterator, error)

FilterPropose is a free log retrieval operation binding the contract event 0x8665d2ae7d62e4273cdfc40af1cbbea2232b315ca2a2e244c833366f2b8ae9eb.

Solidity: event Propose(uint256 id, address proposer, uint8 ptype, address member, uint8 capacity)

func (*ConsortiumManagementFilterer) FilterRemoveOperator added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementFilterer) FilterRemoveOperator(opts *bind.FilterOpts) (*ConsortiumManagementRemoveOperatorIterator, error)

FilterRemoveOperator is a free log retrieval operation binding the contract event 0xb157cf3e9ae29eb366b3bdda54b41d4738ada5daa73f8d2f1bef6280bb1418e4.

Solidity: event RemoveOperator(address member, address operator)

func (*ConsortiumManagementFilterer) FilterSettleProposal added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementFilterer) FilterSettleProposal(opts *bind.FilterOpts) (*ConsortiumManagementSettleProposalIterator, error)

FilterSettleProposal is a free log retrieval operation binding the contract event 0xf412ee5dcd836b3a4fa40ae9d7e90eeea743a32f4e0ba26c91c7cbc8c3d8b44b.

Solidity: event SettleProposal(uint256 id, bool success)

func (*ConsortiumManagementFilterer) FilterUpdateOperatorHealthEndpoint added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementFilterer) FilterUpdateOperatorHealthEndpoint(opts *bind.FilterOpts) (*ConsortiumManagementUpdateOperatorHealthEndpointIterator, error)

FilterUpdateOperatorHealthEndpoint is a free log retrieval operation binding the contract event 0x8daf704ffb23b2e479e9849d1bda8860345f6c15d43b68cd9cf8622952564895.

Solidity: event UpdateOperatorHealthEndpoint(address member, address operator, string endpoint)

func (*ConsortiumManagementFilterer) FilterVote added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementFilterer) FilterVote(opts *bind.FilterOpts) (*ConsortiumManagementVoteIterator, error)

FilterVote is a free log retrieval operation binding the contract event 0xcfa82ef0390c8f3e57ebe6c0665352a383667e792af012d350d9786ee5173d26.

Solidity: event Vote(uint256 id, address voter, bool approve)

func (*ConsortiumManagementFilterer) WatchAddOperator added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementFilterer) WatchAddOperator(opts *bind.WatchOpts, sink chan<- *ConsortiumManagementAddOperator) (event.Subscription, error)

WatchAddOperator is a free log subscription operation binding the contract event 0xc1ad0c93e1873e80f0551582678c47e2e3cd93d9f12f18b1012ed1ad51654d74.

Solidity: event AddOperator(address member, address operator, string endpoint)

func (*ConsortiumManagementFilterer) WatchPropose added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementFilterer) WatchPropose(opts *bind.WatchOpts, sink chan<- *ConsortiumManagementPropose) (event.Subscription, error)

WatchPropose is a free log subscription operation binding the contract event 0x8665d2ae7d62e4273cdfc40af1cbbea2232b315ca2a2e244c833366f2b8ae9eb.

Solidity: event Propose(uint256 id, address proposer, uint8 ptype, address member, uint8 capacity)

func (*ConsortiumManagementFilterer) WatchRemoveOperator added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementFilterer) WatchRemoveOperator(opts *bind.WatchOpts, sink chan<- *ConsortiumManagementRemoveOperator) (event.Subscription, error)

WatchRemoveOperator is a free log subscription operation binding the contract event 0xb157cf3e9ae29eb366b3bdda54b41d4738ada5daa73f8d2f1bef6280bb1418e4.

Solidity: event RemoveOperator(address member, address operator)

func (*ConsortiumManagementFilterer) WatchSettleProposal added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementFilterer) WatchSettleProposal(opts *bind.WatchOpts, sink chan<- *ConsortiumManagementSettleProposal) (event.Subscription, error)

WatchSettleProposal is a free log subscription operation binding the contract event 0xf412ee5dcd836b3a4fa40ae9d7e90eeea743a32f4e0ba26c91c7cbc8c3d8b44b.

Solidity: event SettleProposal(uint256 id, bool success)

func (*ConsortiumManagementFilterer) WatchUpdateOperatorHealthEndpoint added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementFilterer) WatchUpdateOperatorHealthEndpoint(opts *bind.WatchOpts, sink chan<- *ConsortiumManagementUpdateOperatorHealthEndpoint) (event.Subscription, error)

WatchUpdateOperatorHealthEndpoint is a free log subscription operation binding the contract event 0x8daf704ffb23b2e479e9849d1bda8860345f6c15d43b68cd9cf8622952564895.

Solidity: event UpdateOperatorHealthEndpoint(address member, address operator, string endpoint)

func (*ConsortiumManagementFilterer) WatchVote added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementFilterer) WatchVote(opts *bind.WatchOpts, sink chan<- *ConsortiumManagementVote) (event.Subscription, error)

WatchVote is a free log subscription operation binding the contract event 0xcfa82ef0390c8f3e57ebe6c0665352a383667e792af012d350d9786ee5173d26.

Solidity: event Vote(uint256 id, address voter, bool approve)

type ConsortiumManagementPropose added in v1.0.0

type ConsortiumManagementPropose struct {
	Id       *big.Int
	Proposer common.Address
	Ptype    uint8
	Member   common.Address
	Capacity uint8
	Raw      types.Log // Blockchain specific contextual infos
}

ConsortiumManagementPropose represents a Propose event raised by the ConsortiumManagement contract.

type ConsortiumManagementProposeIterator added in v1.0.0

type ConsortiumManagementProposeIterator struct {
	Event *ConsortiumManagementPropose // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

ConsortiumManagementProposeIterator is returned from FilterPropose and is used to iterate over the raw logs and unpacked data for Propose events raised by the ConsortiumManagement contract.

func (*ConsortiumManagementProposeIterator) Close added in v1.0.0

Close terminates the iteration process, releasing any pending underlying resources.

func (*ConsortiumManagementProposeIterator) Error added in v1.0.0

Error returns any retrieval or parsing error occurred during filtering.

func (*ConsortiumManagementProposeIterator) Next added in v1.0.0

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type ConsortiumManagementRaw added in v1.0.0

type ConsortiumManagementRaw struct {
	Contract *ConsortiumManagement // Generic contract binding to access the raw methods on
}

ConsortiumManagementRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*ConsortiumManagementRaw) Call added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*ConsortiumManagementRaw) Transact added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*ConsortiumManagementRaw) Transfer added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type ConsortiumManagementRemoveOperator added in v1.0.0

type ConsortiumManagementRemoveOperator struct {
	Member   common.Address
	Operator common.Address
	Raw      types.Log // Blockchain specific contextual infos
}

ConsortiumManagementRemoveOperator represents a RemoveOperator event raised by the ConsortiumManagement contract.

type ConsortiumManagementRemoveOperatorIterator added in v1.0.0

type ConsortiumManagementRemoveOperatorIterator struct {
	Event *ConsortiumManagementRemoveOperator // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

ConsortiumManagementRemoveOperatorIterator is returned from FilterRemoveOperator and is used to iterate over the raw logs and unpacked data for RemoveOperator events raised by the ConsortiumManagement contract.

func (*ConsortiumManagementRemoveOperatorIterator) Close added in v1.0.0

Close terminates the iteration process, releasing any pending underlying resources.

func (*ConsortiumManagementRemoveOperatorIterator) Error added in v1.0.0

Error returns any retrieval or parsing error occurred during filtering.

func (*ConsortiumManagementRemoveOperatorIterator) Next added in v1.0.0

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type ConsortiumManagementSession added in v1.0.0

type ConsortiumManagementSession struct {
	Contract     *ConsortiumManagement // Generic contract binding to set the session for
	CallOpts     bind.CallOpts         // Call options to use throughout this session
	TransactOpts bind.TransactOpts     // Transaction auth options to use throughout this session
}

ConsortiumManagementSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*ConsortiumManagementSession) AddOperator added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) AddOperator(operator common.Address, endpoint string) (*types.Transaction, error)

AddOperator is a paid mutator transaction binding the contract method 0x2430df89.

Solidity: function addOperator(address operator, string endpoint) returns()

func (*ConsortiumManagementSession) Approve added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) Approve(id *big.Int) (*types.Transaction, error)

Approve is a paid mutator transaction binding the contract method 0xb759f954.

Solidity: function approve(uint256 id) returns()

func (*ConsortiumManagementSession) Delegates added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) Delegates() ([]common.Address, error)

Delegates is a free data retrieval call binding the contract method 0x6138b19e.

Solidity: function delegates() constant returns(address[])

func (*ConsortiumManagementSession) Disapprove added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) Disapprove(id *big.Int) (*types.Transaction, error)

Disapprove is a paid mutator transaction binding the contract method 0x8008df4f.

Solidity: function disapprove(uint256 id) returns()

func (*ConsortiumManagementSession) HealthEndpoint added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) HealthEndpoint(operator common.Address) (string, error)

HealthEndpoint is a free data retrieval call binding the contract method 0xb44d5fc7.

Solidity: function healthEndpoint(address operator) constant returns(string)

func (*ConsortiumManagementSession) IsMember added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) IsMember(addr common.Address) (bool, error)

IsMember is a free data retrieval call binding the contract method 0xa230c524.

Solidity: function isMember(address addr) constant returns(bool)

func (*ConsortiumManagementSession) Members added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) Members() ([]common.Address, error)

Members is a free data retrieval call binding the contract method 0xbdd4d18d.

Solidity: function members() constant returns(address[])

func (*ConsortiumManagementSession) Operators added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) Operators(addr common.Address) ([]common.Address, error)

Operators is a free data retrieval call binding the contract method 0x13e7c9d8.

Solidity: function operators(address addr) constant returns(address[])

func (*ConsortiumManagementSession) Proposal added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) Proposal() (struct {
	Id          *big.Int
	Proposer    common.Address
	Ptype       uint8
	Member      common.Address
	Capacity    uint8
	Approves    []common.Address
	Disapproves []common.Address
}, error)

Proposal is a free data retrieval call binding the contract method 0x753ec103.

Solidity: function proposal() constant returns(uint256 id, address proposer, uint8 ptype, address member, uint8 capacity, address[] approves, address[] disapproves)

func (*ConsortiumManagementSession) ProposeMemberDeletion added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) ProposeMemberDeletion(addr common.Address) (*types.Transaction, error)

ProposeMemberDeletion is a paid mutator transaction binding the contract method 0x555ed8bb.

Solidity: function proposeMemberDeletion(address addr) returns()

func (*ConsortiumManagementSession) ProposeMemberModification added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) ProposeMemberModification(addr common.Address, capacity uint8) (*types.Transaction, error)

ProposeMemberModification is a paid mutator transaction binding the contract method 0xa03eb838.

Solidity: function proposeMemberModification(address addr, uint8 capacity) returns()

func (*ConsortiumManagementSession) ProposeNewMember added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) ProposeNewMember(addr common.Address, capacity uint8) (*types.Transaction, error)

ProposeNewMember is a paid mutator transaction binding the contract method 0x0f6d17f9.

Solidity: function proposeNewMember(address addr, uint8 capacity) returns()

func (*ConsortiumManagementSession) RemoveOperator added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) RemoveOperator(operator common.Address) (*types.Transaction, error)

RemoveOperator is a paid mutator transaction binding the contract method 0xac8a584a.

Solidity: function removeOperator(address operator) returns()

func (*ConsortiumManagementSession) UpdateHealthEndpoint added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementSession) UpdateHealthEndpoint(operator common.Address, endpoint string) (*types.Transaction, error)

UpdateHealthEndpoint is a paid mutator transaction binding the contract method 0xe1d1f053.

Solidity: function updateHealthEndpoint(address operator, string endpoint) returns()

type ConsortiumManagementSettleProposal added in v1.0.0

type ConsortiumManagementSettleProposal struct {
	Id      *big.Int
	Success bool
	Raw     types.Log // Blockchain specific contextual infos
}

ConsortiumManagementSettleProposal represents a SettleProposal event raised by the ConsortiumManagement contract.

type ConsortiumManagementSettleProposalIterator added in v1.0.0

type ConsortiumManagementSettleProposalIterator struct {
	Event *ConsortiumManagementSettleProposal // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

ConsortiumManagementSettleProposalIterator is returned from FilterSettleProposal and is used to iterate over the raw logs and unpacked data for SettleProposal events raised by the ConsortiumManagement contract.

func (*ConsortiumManagementSettleProposalIterator) Close added in v1.0.0

Close terminates the iteration process, releasing any pending underlying resources.

func (*ConsortiumManagementSettleProposalIterator) Error added in v1.0.0

Error returns any retrieval or parsing error occurred during filtering.

func (*ConsortiumManagementSettleProposalIterator) Next added in v1.0.0

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type ConsortiumManagementTransactor added in v1.0.0

type ConsortiumManagementTransactor struct {
	// contains filtered or unexported fields
}

ConsortiumManagementTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewConsortiumManagementTransactor added in v1.0.0

func NewConsortiumManagementTransactor(address common.Address, transactor bind.ContractTransactor) (*ConsortiumManagementTransactor, error)

NewConsortiumManagementTransactor creates a new write-only instance of ConsortiumManagement, bound to a specific deployed contract.

func (*ConsortiumManagementTransactor) AddOperator added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactor) AddOperator(opts *bind.TransactOpts, operator common.Address, endpoint string) (*types.Transaction, error)

AddOperator is a paid mutator transaction binding the contract method 0x2430df89.

Solidity: function addOperator(address operator, string endpoint) returns()

func (*ConsortiumManagementTransactor) Approve added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactor) Approve(opts *bind.TransactOpts, id *big.Int) (*types.Transaction, error)

Approve is a paid mutator transaction binding the contract method 0xb759f954.

Solidity: function approve(uint256 id) returns()

func (*ConsortiumManagementTransactor) Disapprove added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactor) Disapprove(opts *bind.TransactOpts, id *big.Int) (*types.Transaction, error)

Disapprove is a paid mutator transaction binding the contract method 0x8008df4f.

Solidity: function disapprove(uint256 id) returns()

func (*ConsortiumManagementTransactor) ProposeMemberDeletion added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactor) ProposeMemberDeletion(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error)

ProposeMemberDeletion is a paid mutator transaction binding the contract method 0x555ed8bb.

Solidity: function proposeMemberDeletion(address addr) returns()

func (*ConsortiumManagementTransactor) ProposeMemberModification added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactor) ProposeMemberModification(opts *bind.TransactOpts, addr common.Address, capacity uint8) (*types.Transaction, error)

ProposeMemberModification is a paid mutator transaction binding the contract method 0xa03eb838.

Solidity: function proposeMemberModification(address addr, uint8 capacity) returns()

func (*ConsortiumManagementTransactor) ProposeNewMember added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactor) ProposeNewMember(opts *bind.TransactOpts, addr common.Address, capacity uint8) (*types.Transaction, error)

ProposeNewMember is a paid mutator transaction binding the contract method 0x0f6d17f9.

Solidity: function proposeNewMember(address addr, uint8 capacity) returns()

func (*ConsortiumManagementTransactor) RemoveOperator added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactor) RemoveOperator(opts *bind.TransactOpts, operator common.Address) (*types.Transaction, error)

RemoveOperator is a paid mutator transaction binding the contract method 0xac8a584a.

Solidity: function removeOperator(address operator) returns()

func (*ConsortiumManagementTransactor) UpdateHealthEndpoint added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactor) UpdateHealthEndpoint(opts *bind.TransactOpts, operator common.Address, endpoint string) (*types.Transaction, error)

UpdateHealthEndpoint is a paid mutator transaction binding the contract method 0xe1d1f053.

Solidity: function updateHealthEndpoint(address operator, string endpoint) returns()

type ConsortiumManagementTransactorRaw added in v1.0.0

type ConsortiumManagementTransactorRaw struct {
	Contract *ConsortiumManagementTransactor // Generic write-only contract binding to access the raw methods on
}

ConsortiumManagementTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*ConsortiumManagementTransactorRaw) Transact added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*ConsortiumManagementTransactorRaw) Transfer added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type ConsortiumManagementTransactorSession added in v1.0.0

type ConsortiumManagementTransactorSession struct {
	Contract     *ConsortiumManagementTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts               // Transaction auth options to use throughout this session
}

ConsortiumManagementTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

func (*ConsortiumManagementTransactorSession) AddOperator added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) AddOperator(operator common.Address, endpoint string) (*types.Transaction, error)

AddOperator is a paid mutator transaction binding the contract method 0x2430df89.

Solidity: function addOperator(address operator, string endpoint) returns()

func (*ConsortiumManagementTransactorSession) Approve added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) Approve(id *big.Int) (*types.Transaction, error)

Approve is a paid mutator transaction binding the contract method 0xb759f954.

Solidity: function approve(uint256 id) returns()

func (*ConsortiumManagementTransactorSession) Disapprove added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) Disapprove(id *big.Int) (*types.Transaction, error)

Disapprove is a paid mutator transaction binding the contract method 0x8008df4f.

Solidity: function disapprove(uint256 id) returns()

func (*ConsortiumManagementTransactorSession) ProposeMemberDeletion added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) ProposeMemberDeletion(addr common.Address) (*types.Transaction, error)

ProposeMemberDeletion is a paid mutator transaction binding the contract method 0x555ed8bb.

Solidity: function proposeMemberDeletion(address addr) returns()

func (*ConsortiumManagementTransactorSession) ProposeMemberModification added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) ProposeMemberModification(addr common.Address, capacity uint8) (*types.Transaction, error)

ProposeMemberModification is a paid mutator transaction binding the contract method 0xa03eb838.

Solidity: function proposeMemberModification(address addr, uint8 capacity) returns()

func (*ConsortiumManagementTransactorSession) ProposeNewMember added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) ProposeNewMember(addr common.Address, capacity uint8) (*types.Transaction, error)

ProposeNewMember is a paid mutator transaction binding the contract method 0x0f6d17f9.

Solidity: function proposeNewMember(address addr, uint8 capacity) returns()

func (*ConsortiumManagementTransactorSession) RemoveOperator added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) RemoveOperator(operator common.Address) (*types.Transaction, error)

RemoveOperator is a paid mutator transaction binding the contract method 0xac8a584a.

Solidity: function removeOperator(address operator) returns()

func (*ConsortiumManagementTransactorSession) UpdateHealthEndpoint added in v1.0.0

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) UpdateHealthEndpoint(operator common.Address, endpoint string) (*types.Transaction, error)

UpdateHealthEndpoint is a paid mutator transaction binding the contract method 0xe1d1f053.

Solidity: function updateHealthEndpoint(address operator, string endpoint) returns()

type ConsortiumManagementUpdateOperatorHealthEndpoint added in v1.0.0

type ConsortiumManagementUpdateOperatorHealthEndpoint struct {
	Member   common.Address
	Operator common.Address
	Endpoint string
	Raw      types.Log // Blockchain specific contextual infos
}

ConsortiumManagementUpdateOperatorHealthEndpoint represents a UpdateOperatorHealthEndpoint event raised by the ConsortiumManagement contract.

type ConsortiumManagementUpdateOperatorHealthEndpointIterator added in v1.0.0

type ConsortiumManagementUpdateOperatorHealthEndpointIterator struct {
	Event *ConsortiumManagementUpdateOperatorHealthEndpoint // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

ConsortiumManagementUpdateOperatorHealthEndpointIterator is returned from FilterUpdateOperatorHealthEndpoint and is used to iterate over the raw logs and unpacked data for UpdateOperatorHealthEndpoint events raised by the ConsortiumManagement contract.

func (*ConsortiumManagementUpdateOperatorHealthEndpointIterator) Close added in v1.0.0

Close terminates the iteration process, releasing any pending underlying resources.

func (*ConsortiumManagementUpdateOperatorHealthEndpointIterator) Error added in v1.0.0

Error returns any retrieval or parsing error occurred during filtering.

func (*ConsortiumManagementUpdateOperatorHealthEndpointIterator) Next added in v1.0.0

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type ConsortiumManagementVote added in v1.0.0

type ConsortiumManagementVote struct {
	Id      *big.Int
	Voter   common.Address
	Approve bool
	Raw     types.Log // Blockchain specific contextual infos
}

ConsortiumManagementVote represents a Vote event raised by the ConsortiumManagement contract.

type ConsortiumManagementVoteIterator added in v1.0.0

type ConsortiumManagementVoteIterator struct {
	Event *ConsortiumManagementVote // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

ConsortiumManagementVoteIterator is returned from FilterVote and is used to iterate over the raw logs and unpacked data for Vote events raised by the ConsortiumManagement contract.

func (*ConsortiumManagementVoteIterator) Close added in v1.0.0

Close terminates the iteration process, releasing any pending underlying resources.

func (*ConsortiumManagementVoteIterator) Error added in v1.0.0

Error returns any retrieval or parsing error occurred during filtering.

func (*ConsortiumManagementVoteIterator) Next added in v1.0.0

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type GetBlockTime

type GetBlockTime func(uint64) (time.Time, error)

GetBlockTime defines a function to get block creation time

type GetCandidates added in v0.11.0

type GetCandidates func(protocol.StateReader, uint64, bool, bool) ([]*state.Candidate, uint64, error)

GetCandidates returns the current candidates

type GetProbationList added in v1.0.0

type GetProbationList func(protocol.StateReader, bool) (*vote.ProbationList, uint64, error)

GetProbationList returns current the ProbationList

type GetUnproductiveDelegate added in v0.11.0

type GetUnproductiveDelegate func(protocol.StateReader) (*vote.UnproductiveDelegate, error)

GetUnproductiveDelegate returns unproductiveDelegate struct which contains a cache of upd info by epochs

type NativeStaking added in v0.8.4

type NativeStaking struct {
	// contains filtered or unexported fields
}

NativeStaking represents native staking struct

func NewNativeStaking added in v0.8.4

func NewNativeStaking(readContract ReadContract) (*NativeStaking, error)

NewNativeStaking creates a NativeStaking instance

func (*NativeStaking) SetContract added in v0.9.0

func (ns *NativeStaking) SetContract(contract string)

SetContract sets the contract address

func (*NativeStaking) Votes added in v0.8.4

func (ns *NativeStaking) Votes(ctx context.Context, ts time.Time, correctGas bool) (*VoteTally, error)

Votes returns the votes on height

type Productivity added in v1.0.0

type Productivity func(uint64, uint64) (map[string]uint64, error)

Productivity returns the number of produced blocks per producer

type Protocol

type Protocol interface {
	protocol.Protocol
	protocol.ActionValidator
	protocol.GenesisStateCreator
	Delegates(context.Context, protocol.StateReader) (state.CandidateList, error)
	NextDelegates(context.Context, protocol.StateReader) (state.CandidateList, error)
	Candidates(context.Context, protocol.StateReader) (state.CandidateList, error)
	NextCandidates(context.Context, protocol.StateReader) (state.CandidateList, error)
	// CalculateCandidatesByHeight calculates candidate and returns candidates by chain height
	// TODO: remove height, and read it from state reader
	CalculateCandidatesByHeight(context.Context, protocol.StateReader, uint64) (state.CandidateList, error)
}

Protocol defines the protocol of handling votes

func FindProtocol added in v0.11.0

func FindProtocol(registry *protocol.Registry) Protocol

FindProtocol finds the registered protocol from registry

func MustGetProtocol added in v0.11.0

func MustGetProtocol(registry *protocol.Registry) Protocol

MustGetProtocol return a registered protocol from registry

func NewConsortiumCommittee added in v1.0.0

func NewConsortiumCommittee(indexer *CandidateIndexer, readContract ReadContract, getBlockHash evm.GetBlockHash) (Protocol, error)

NewConsortiumCommittee creates a committee for consorium chain

func NewGovernanceChainCommitteeProtocol

func NewGovernanceChainCommitteeProtocol(
	candidatesIndexer *CandidateIndexer,
	electionCommittee committee.Committee,
	initGravityChainHeight uint64,
	getBlockTime GetBlockTime,
	initialCandidatesInterval time.Duration,
	sh *Slasher,
) (Protocol, error)

NewGovernanceChainCommitteeProtocol creates a Poll Protocol which fetch result from governance chain

func NewLifeLongDelegatesProtocol

func NewLifeLongDelegatesProtocol(delegates []genesis.Delegate) Protocol

NewLifeLongDelegatesProtocol creates a poll protocol with life long delegates

func NewProtocol added in v0.11.0

func NewProtocol(
	cfg config.Config,
	candidateIndexer *CandidateIndexer,
	readContract ReadContract,
	getCandidates GetCandidates,
	getprobationList GetProbationList,
	getUnproductiveDelegate GetUnproductiveDelegate,
	electionCommittee committee.Committee,
	stakingProto *staking.Protocol,
	getBlockTimeFunc GetBlockTime,
	productivity Productivity,
	getBlockHash evm.GetBlockHash,
) (Protocol, error)

NewProtocol instantiates a rewarding protocol instance.

func NewStakingCommand added in v0.11.0

func NewStakingCommand(stkV1 Protocol, stkV2 Protocol) (Protocol, error)

NewStakingCommand creates a staking command center to manage staking committee and new native staking

func NewStakingCommittee added in v0.8.4

func NewStakingCommittee(
	ec committee.Committee,
	gs Protocol,
	readContract ReadContract,
	nativeStakingContractAddress string,
	nativeStakingContractCode string,
	scoreThreshold *big.Int,
) (Protocol, error)

NewStakingCommittee creates a staking committee which fetch result from governance chain and native staking

type ReadContract added in v0.11.0

type ReadContract func(context.Context, string, []byte, bool) ([]byte, error)

ReadContract defines a callback function to read contract

type Slasher added in v1.0.0

type Slasher struct {
	// contains filtered or unexported fields
}

Slasher is the module to slash candidates

func NewSlasher added in v1.0.0

func NewSlasher(
	gen *genesis.Genesis,
	productivity Productivity,
	getCandidates GetCandidates,
	getProbationList GetProbationList,
	getUnprodDelegate GetUnproductiveDelegate,
	indexer *CandidateIndexer,
	numCandidateDelegates, numDelegates, thres, koPeriod, maxKoPeriod uint64,
	koIntensity uint32,
) (*Slasher, error)

NewSlasher returns a new Slasher

func (*Slasher) CalculateProbationList added in v1.0.0

func (sh *Slasher) CalculateProbationList(
	ctx context.Context,
	sm protocol.StateManager,
	epochNum uint64,
) (*vote.ProbationList, error)

CalculateProbationList calculates probation list according to productivity

func (*Slasher) CreateGenesisStates added in v1.0.0

func (sh *Slasher) CreateGenesisStates(ctx context.Context, sm protocol.StateManager, indexer *CandidateIndexer) error

CreateGenesisStates creates genesis state for slasher

func (*Slasher) CreatePreStates added in v1.0.0

func (sh *Slasher) CreatePreStates(ctx context.Context, sm protocol.StateManager, indexer *CandidateIndexer) error

CreatePreStates is to setup probation list

func (*Slasher) GetABPFromIndexer added in v1.0.0

func (sh *Slasher) GetABPFromIndexer(ctx context.Context, epochStartHeight uint64) (state.CandidateList, error)

GetABPFromIndexer returns active BP list from indexer

func (*Slasher) GetActiveBlockProducers added in v1.0.0

func (sh *Slasher) GetActiveBlockProducers(ctx context.Context, sr protocol.StateReader, readFromNext bool) (state.CandidateList, error)

GetActiveBlockProducers returns active BP list

func (*Slasher) GetBPFromIndexer added in v1.0.0

func (sh *Slasher) GetBPFromIndexer(ctx context.Context, epochStartHeight uint64) (state.CandidateList, error)

GetBPFromIndexer returns BP list from indexer

func (*Slasher) GetBlockProducers added in v1.0.0

func (sh *Slasher) GetBlockProducers(ctx context.Context, sr protocol.StateReader, readFromNext bool) (state.CandidateList, error)

GetBlockProducers returns BP list

func (*Slasher) GetCandidates added in v1.0.0

func (sh *Slasher) GetCandidates(ctx context.Context, sr protocol.StateReader, readFromNext bool) (state.CandidateList, error)

GetCandidates returns filtered candidate list

func (*Slasher) GetCandidatesFromIndexer added in v1.0.0

func (sh *Slasher) GetCandidatesFromIndexer(ctx context.Context, epochStartHeight uint64) (state.CandidateList, error)

GetCandidatesFromIndexer returns candidate list from indexer

func (*Slasher) GetProbationList added in v1.0.0

func (sh *Slasher) GetProbationList(ctx context.Context, sr protocol.StateReader, readFromNext bool) (*vote.ProbationList, error)

GetProbationList returns the probation list at given epoch

func (*Slasher) ReadState added in v1.0.0

func (sh *Slasher) ReadState(
	ctx context.Context,
	sr protocol.StateReader,
	indexer *CandidateIndexer,
	method []byte,
	args ...[]byte,
) ([]byte, error)

ReadState defines slasher's read methods.

type VoteTally added in v0.8.4

type VoteTally struct {
	Candidates map[[12]byte]*state.Candidate
	Buckets    []*types.Bucket
}

VoteTally is a map of candidates on native chain

Jump to

Keyboard shortcuts

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