Documentation ¶
Index ¶
- Constants
- type DepositorListOrder
- type DepositorRow
- type DepositorWithMonikerRow
- type Depositors
- type DepositorsTotal
- type DepositorsTotalView
- type DepositorsView
- type MockDepositorsTotalView
- func (view *MockDepositorsTotalView) DecrementAll(identities []string, total int64) error
- func (view *MockDepositorsTotalView) FindBy(identity string) (int64, error)
- func (view *MockDepositorsTotalView) Increment(identity string, total int64) error
- func (view *MockDepositorsTotalView) IncrementAll(identities []string, total int64) error
- func (view *MockDepositorsTotalView) Set(identity string, total int64) error
- func (view *MockDepositorsTotalView) SumBy(identities []string) (int64, error)
- type MockDepositorsView
- type MockProposalsView
- func (proposalsView *MockProposalsView) FindById(proposalId string) (*ProposalWithMonikerRow, error)
- func (proposalsView *MockProposalsView) IncrementTotalVoteBy(proposalId uint64, voteToAdd *big.Int) error
- func (proposalsView *MockProposalsView) Insert(row *ProposalRow) error
- func (proposalsView *MockProposalsView) List(filter ProposalListFilter, order ProposalListOrder, ...) ([]ProposalWithMonikerRow, *pagination2.PaginationResult, error)
- func (proposalsView *MockProposalsView) Update(row *ProposalRow) error
- type MockVotesTotalView
- func (view *MockVotesTotalView) DecrementAll(identities []string, total int64) error
- func (view *MockVotesTotalView) FindBy(identity string) (int64, error)
- func (view *MockVotesTotalView) Increment(identity string, total int64) error
- func (view *MockVotesTotalView) IncrementAll(identities []string, total int64) error
- func (view *MockVotesTotalView) Set(identity string, total int64) error
- func (view *MockVotesTotalView) SumBy(identities []string) (int64, error)
- type MockVotesView
- func (votesView *MockVotesView) FindByProposalIdVoter(proposalId string, voterAddress string) (*VoteWithMonikerRow, error)
- func (votesView *MockVotesView) Insert(row *VoteRow) error
- func (votesView *MockVotesView) ListByProposalId(proposalId string, order VoteListOrder, pagination *pagination2.Pagination) ([]VoteWithMonikerRow, *pagination2.PaginationResult, error)
- func (votesView *MockVotesView) Update(row *VoteRow) error
- type ProposalListFilter
- type ProposalListOrder
- type ProposalRow
- type ProposalWithMonikerRow
- type Proposals
- type ProposalsView
- func (proposalView *ProposalsView) FindById(proposalId string) (*ProposalWithMonikerRow, error)
- func (proposalView *ProposalsView) IncrementTotalVoteBy(proposalId uint64, voteToAdd *big.Int) error
- func (proposalView *ProposalsView) Insert(proposal *ProposalRow) error
- func (proposalView *ProposalsView) List(filter ProposalListFilter, order ProposalListOrder, ...) ([]ProposalWithMonikerRow, *pagination_interface.PaginationResult, error)
- func (proposalView *ProposalsView) Update(row *ProposalRow) error
- type VoteHistory
- type VoteListOrder
- type VoteRow
- type VoteWithMonikerRow
- type Votes
- type VotesTotal
- type VotesTotalView
- type VotesView
- func (votesView *VotesView) FindByProposalIdVoter(proposalId string, voterAddress string) (*VoteWithMonikerRow, error)
- func (votesView *VotesView) Insert(row *VoteRow) error
- func (votesView *VotesView) ListByProposalId(proposalId string, order VoteListOrder, pagination *pagination.Pagination) ([]VoteWithMonikerRow, *pagination.PaginationResult, error)
- func (votesView *VotesView) Update(row *VoteRow) error
Constants ¶
View Source
const DEPOSITORS_TABLE_NAME = "view_proposal_depositors"
View Source
const DEPOSITORS_TOTAL_TABLE_NAME = "view_proposal_depositors_total"
View Source
const PARAMS_TABLE_NAME = "view_proposal_params"
View Source
const PROPOSALS_TABLE_NAME = "view_proposals"
View Source
const PROPOSAL_STATUS_DEPOSIT_PERIOD = "DEPOSIT_PERIOD"
View Source
const PROPOSAL_STATUS_FAILED = "FAILED"
View Source
const PROPOSAL_STATUS_INACTIVE = "INACTIVE"
View Source
const PROPOSAL_STATUS_PASSED = "PASSED"
View Source
const PROPOSAL_STATUS_REJECTED = "REJECTED"
View Source
const PROPOSAL_STATUS_VOTING_PERIOD = "VOTING_PERIOD"
View Source
const VALIDATORS_TABLE_NAME = "view_proposal_validators"
View Source
const VOTES_TABLE_NAME = "view_proposal_votes"
View Source
const VOTES_TOTAL_TABLE_NAME = "view_proposal_votes_total"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DepositorListOrder ¶
type DepositorRow ¶
type DepositorRow struct { ProposalId string `json:"proposalId"` DepositorAddress string `json:"depositorAddress"` MaybeDepositorOperatorAddress *string `json:"maybeDepositorValidatorAddress"` TransactionHash string `json:"transactionHash"` DepositAtBlockHeight int64 `json:"depositAtBlockHeight"` DepositAtBlockTime utctime.UTCTime `json:"depositAtBlockTime"` Amount coin.Coins `json:"amount"` }
type DepositorWithMonikerRow ¶
type DepositorWithMonikerRow struct { DepositorRow MaybeDepositorMoniker *string `json:"maybeDepositorMoniker"` }
type Depositors ¶
type Depositors interface { Insert(row *DepositorRow) error ListByProposalId( proposalId string, order DepositorListOrder, pagination *pagination.Pagination, ) ( []DepositorWithMonikerRow, *pagination.PaginationResult, error, ) }
func NewDepositorsView ¶
func NewDepositorsView(handle *rdb.Handle) Depositors
func NewMockDepositorsView ¶
func NewMockDepositorsView() Depositors
type DepositorsTotal ¶
type DepositorsTotal interface { Set(string, int64) error Increment(string, int64) error IncrementAll([]string, int64) error DecrementAll([]string, int64) error FindBy(string) (int64, error) SumBy([]string) (int64, error) }
func NewDepositorsTotalView ¶
func NewDepositorsTotalView(rdbHandle *rdb.Handle) DepositorsTotal
func NewMockDepositorsTotalView ¶
func NewMockDepositorsTotalView(_ *rdb.Handle) DepositorsTotal
type DepositorsTotalView ¶
type DepositorsView ¶
type DepositorsView struct {
// contains filtered or unexported fields
}
func (*DepositorsView) Insert ¶
func (depositorsView *DepositorsView) Insert(row *DepositorRow) error
func (*DepositorsView) ListByProposalId ¶
func (depositorsView *DepositorsView) ListByProposalId( proposalId string, order DepositorListOrder, pagination *pagination.Pagination, ) ([]DepositorWithMonikerRow, *pagination.PaginationResult, error)
type MockDepositorsTotalView ¶
func (*MockDepositorsTotalView) DecrementAll ¶
func (view *MockDepositorsTotalView) DecrementAll(identities []string, total int64) error
func (*MockDepositorsTotalView) FindBy ¶
func (view *MockDepositorsTotalView) FindBy(identity string) (int64, error)
func (*MockDepositorsTotalView) Increment ¶
func (view *MockDepositorsTotalView) Increment(identity string, total int64) error
func (*MockDepositorsTotalView) IncrementAll ¶
func (view *MockDepositorsTotalView) IncrementAll(identities []string, total int64) error
type MockDepositorsView ¶
type MockDepositorsView struct {
testify_mock.Mock
}
func (*MockDepositorsView) Insert ¶
func (depositorsView *MockDepositorsView) Insert(row *DepositorRow) error
func (*MockDepositorsView) ListByProposalId ¶
func (depositorsView *MockDepositorsView) ListByProposalId( proposalId string, order DepositorListOrder, pagination *pagination2.Pagination, ) ( []DepositorWithMonikerRow, *pagination2.PaginationResult, error, )
type MockProposalsView ¶
type MockProposalsView struct {
testify_mock.Mock
}
func (*MockProposalsView) FindById ¶
func (proposalsView *MockProposalsView) FindById( proposalId string, ) ( *ProposalWithMonikerRow, error, )
func (*MockProposalsView) IncrementTotalVoteBy ¶
func (proposalsView *MockProposalsView) IncrementTotalVoteBy( proposalId uint64, voteToAdd *big.Int, ) error
func (*MockProposalsView) Insert ¶
func (proposalsView *MockProposalsView) Insert(row *ProposalRow) error
func (*MockProposalsView) List ¶
func (proposalsView *MockProposalsView) List( filter ProposalListFilter, order ProposalListOrder, pagination *pagination2.Pagination, ) ( []ProposalWithMonikerRow, *pagination2.PaginationResult, error, )
func (*MockProposalsView) Update ¶
func (proposalsView *MockProposalsView) Update(row *ProposalRow) error
type MockVotesTotalView ¶
func (*MockVotesTotalView) DecrementAll ¶
func (view *MockVotesTotalView) DecrementAll(identities []string, total int64) error
func (*MockVotesTotalView) FindBy ¶
func (view *MockVotesTotalView) FindBy(identity string) (int64, error)
func (*MockVotesTotalView) Increment ¶
func (view *MockVotesTotalView) Increment(identity string, total int64) error
func (*MockVotesTotalView) IncrementAll ¶
func (view *MockVotesTotalView) IncrementAll(identities []string, total int64) error
type MockVotesView ¶
type MockVotesView struct {
testify_mock.Mock
}
func (*MockVotesView) FindByProposalIdVoter ¶
func (votesView *MockVotesView) FindByProposalIdVoter( proposalId string, voterAddress string, ) ( *VoteWithMonikerRow, error, )
func (*MockVotesView) Insert ¶
func (votesView *MockVotesView) Insert(row *VoteRow) error
func (*MockVotesView) ListByProposalId ¶
func (votesView *MockVotesView) ListByProposalId( proposalId string, order VoteListOrder, pagination *pagination2.Pagination, ) ( []VoteWithMonikerRow, *pagination2.PaginationResult, error, )
func (*MockVotesView) Update ¶
func (votesView *MockVotesView) Update(row *VoteRow) error
type ProposalListFilter ¶
type ProposalListFilter struct {
MaybeStatus *string
}
type ProposalListOrder ¶
type ProposalRow ¶
type ProposalRow struct { ProposalId string `json:"id"` Title string `json:"title"` Description string `json:"description"` Type string `json:"type"` Status string `json:"status"` ProposerAddress string `json:"proposerAddress"` MaybeProposerOperatorAddress *string `json:"maybeProposerOperatorAddress"` Data interface{} `json:"data"` InitialDeposit coin.Coins `json:"initialDeposit"` TotalDeposit coin.Coins `json:"totalDeposit"` TotalVote *big.Int `json:"totalVote"` TransactionHash string `json:"transactionHash"` SubmitBlockHeight int64 `json:"submitBlockHeight"` SubmitTime utctime.UTCTime `json:"submitTime"` DepositEndTime utctime.UTCTime `json:"depositEndTime"` MaybeVotingStartTime *utctime.UTCTime `json:"maybeVotingStartTime"` MaybeVotingEndBlockHeight *int64 `json:"maybeVotingEndBlockHeight"` MaybeVotingEndTime *utctime.UTCTime `json:"maybeVotingEndTime"` }
type ProposalWithMonikerRow ¶
type ProposalWithMonikerRow struct { ProposalRow MaybeProposerMoniker *string `json:"maybeProposerMoniker"` }
type Proposals ¶
type Proposals interface { Insert(proposal *ProposalRow) error IncrementTotalVoteBy(proposalId uint64, voteToAdd *big.Int) error Update(row *ProposalRow) error FindById(proposalId string) (*ProposalWithMonikerRow, error) List( filter ProposalListFilter, order ProposalListOrder, pagination *pagination_interface.Pagination, ) ( []ProposalWithMonikerRow, *pagination_interface.PaginationResult, error, ) }
func NewMockProposalsView ¶
func NewMockProposalsView() Proposals
func NewProposalsView ¶
type ProposalsView ¶
type ProposalsView struct {
// contains filtered or unexported fields
}
func (*ProposalsView) FindById ¶
func (proposalView *ProposalsView) FindById(proposalId string) (*ProposalWithMonikerRow, error)
func (*ProposalsView) IncrementTotalVoteBy ¶
func (proposalView *ProposalsView) IncrementTotalVoteBy(proposalId uint64, voteToAdd *big.Int) error
func (*ProposalsView) Insert ¶
func (proposalView *ProposalsView) Insert(proposal *ProposalRow) error
func (*ProposalsView) List ¶
func (proposalView *ProposalsView) List( filter ProposalListFilter, order ProposalListOrder, pagination *pagination_interface.Pagination, ) ([]ProposalWithMonikerRow, *pagination_interface.PaginationResult, error)
func (*ProposalsView) Update ¶
func (proposalView *ProposalsView) Update(row *ProposalRow) error
type VoteHistory ¶
type VoteListOrder ¶
type VoteRow ¶
type VoteRow struct { ProposalId string `json:"proposalId"` VoterAddress string `json:"voterAddress"` MaybeVoterOperatorAddress *string `json:"maybeVoterOperatorAddress"` TransactionHash string `json:"transactionHash"` VoteAtBlockHeight int64 `json:"voteAtBlockHeight"` VoteAtBlockTime utctime.UTCTime `json:"voteAtBlockTime"` Answer string `json:"answer"` Histories []VoteHistory `json:"histories"` }
type VoteWithMonikerRow ¶
type Votes ¶
type Votes interface { Insert(row *VoteRow) error Update(row *VoteRow) error FindByProposalIdVoter( proposalId string, voterAddress string, ) (*VoteWithMonikerRow, error) ListByProposalId( proposalId string, order VoteListOrder, pagination *pagination.Pagination, ) ([]VoteWithMonikerRow, *pagination.PaginationResult, error) }
func NewMockVotesView ¶
func NewMockVotesView() Votes
func NewVotesView ¶
type VotesTotal ¶
type VotesTotal interface { Set(string, int64) error Increment(string, int64) error IncrementAll([]string, int64) error DecrementAll([]string, int64) error FindBy(string) (int64, error) SumBy([]string) (int64, error) }
func NewMockVotesTotalView ¶
func NewMockVotesTotalView(_ *rdb.Handle) VotesTotal
func NewVotesTotalView ¶
func NewVotesTotalView(rdbHandle *rdb.Handle) VotesTotal
type VotesTotalView ¶
type VotesView ¶
type VotesView struct {
// contains filtered or unexported fields
}
func (*VotesView) FindByProposalIdVoter ¶
func (votesView *VotesView) FindByProposalIdVoter(proposalId string, voterAddress string) (*VoteWithMonikerRow, error)
func (*VotesView) ListByProposalId ¶
func (votesView *VotesView) ListByProposalId( proposalId string, order VoteListOrder, pagination *pagination.Pagination, ) ([]VoteWithMonikerRow, *pagination.PaginationResult, error)
Click to show internal directories.
Click to hide internal directories.