Documentation
¶
Index ¶
Constants ¶
View Source
const (
LogChanMaxSize = 1000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseProposal ¶
type BaseProposal struct { ID uint64 Type ProposalType Strategy ProposalStrategy Proposer string Title string Desc string BlockNumber uint64 // totalVotes is total votes for this proposal // attention: some users may not vote for this proposal TotalVotes uint64 // passVotes record user address for passed vote PassVotes []string RejectVotes []string Status ProposalStatus }
type Guardian ¶
type Guardian struct { Ctx context.Context Client Client Logger *logrus.Logger DB storage.Storage Config *repo.Config // Subscribe log FromBlock *big.Int ToBlock *big.Int Addresses []common.Address Topics [][]common.Hash LogChan chan types.Log LogSub ethereum.Subscription // contains filtered or unexported fields }
func NewGuardian ¶
type MockClient ¶
type MockClient struct { }
func (*MockClient) FilterLogs ¶
func (*MockClient) SubscribeFilterLogs ¶
type MockSubscription ¶
type MockSubscription struct { }
func (*MockSubscription) Err ¶
func (ms *MockSubscription) Err() <-chan error
func (*MockSubscription) Unsubscribe ¶
func (ms *MockSubscription) Unsubscribe()
type NodeProposal ¶
type NodeProposal struct { BaseProposal DownloadUrls []string CheckHash string }
type ProposalStatus ¶
type ProposalStatus uint8
const ( Voting ProposalStatus = iota Approved Rejected )
type ProposalStrategy ¶
type ProposalStrategy uint8
const ( // SimpleStrategy means proposal is approved if pass votes is greater than half of total votes SimpleStrategy ProposalStrategy = iota )
type ProposalType ¶
type ProposalType uint8
const ( // CouncilElect is a proposal for elect the council CouncilElect ProposalType = iota // NodeUpgrade is a proposal for update or upgrade the node NodeUpgrade // NodeAdd is a proposal for adding a new node NodeAdd // NodeRemove is a proposal for removing a node NodeRemove )
Click to show internal directories.
Click to hide internal directories.