postgres

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContractRegistryVotingTable        = "contract_registry_votings"
	ContractRegistryAddressVotingTable = "contract_registry_address_votings"
	ContractRegistryUpgradeVotingTable = "contract_registry_upgrade_votings"
)
View Source
const EpochLength = 101

Variables

This section is empty.

Functions

func NewLayerZeroListQ added in v1.0.0

func NewLayerZeroListQ(db *pgdb.DB) data.LayerZeroListStorage

func NewSystemContractsStorage added in v1.0.0

func NewSystemContractsStorage(db *pgdb.DB) data.SystemContractsStorage

func UnionAll added in v1.0.0

func UnionAll(mainQuery *squirrel.SelectBuilder, query squirrel.SelectBuilder) error

Types

type AllVotings

type AllVotings struct {
	Cvotings      []data.GeneralVoting
	GUvotings     []data.GeneralVoting
	EUvotings     []data.GeneralVoting
	Rvotings      []data.GeneralVoting
	RSvotings     []data.GeneralVoting
	VSvotings     []data.GeneralVoting
	EPQFIMvotings []data.GeneralVoting
	EPQFIPvotings []data.GeneralVoting
	EPDRMvotings  []data.GeneralVoting
	EPDRPvotings  []data.GeneralVoting
	EPRSMvotings  []data.GeneralVoting
	EPRSPvotings  []data.GeneralVoting
	CRAvotings    []data.GeneralVoting
	CRUvotings    []data.GeneralVoting
	CRvotings     []data.GeneralVoting
}

type BlockStorage

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

BlockStorage implements data.BlockStorage.

func (*BlockStorage) Erase

func (s *BlockStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*BlockStorage) GetBlockEarlierThan

func (s *BlockStorage) GetBlockEarlierThan(timestamp int64) (*data.Block, error)

func (*BlockStorage) GetByNumber

func (s *BlockStorage) GetByNumber(number uint64) (*data.Block, error)

func (*BlockStorage) GetLatest

func (s *BlockStorage) GetLatest() (*data.Block, error)

GetLatest block.

func (*BlockStorage) Insert

func (s *BlockStorage) Insert(block *data.Block) error

func (*BlockStorage) Select

func (s *BlockStorage) Select(params *data.SelectBlocksParams) ([]data.Block, error)

Select blocks with params.

type ConstitutionVotingStorage

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

ConstitutionVotingStorage implements data.ConstitutionVotingStorage.

func (*ConstitutionVotingStorage) GetEarliestUnfinishedVotings

func (s *ConstitutionVotingStorage) GetEarliestUnfinishedVotings() ([]data.ConstitutionVoting, error)

func (*ConstitutionVotingStorage) GetLatest

GetLatest block.

func (*ConstitutionVotingStorage) Insert

func (*ConstitutionVotingStorage) Update

type ContractRegistryVotingStorage added in v1.1.0

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

ContractRegistryVotingStorage implements data.ContractRegistryVotingStorage.

func (*ContractRegistryVotingStorage) GetEarliestUnfinishedVotings added in v1.1.0

func (s *ContractRegistryVotingStorage) GetEarliestUnfinishedVotings() ([]data.ContractRegistryVoting, error)

func (*ContractRegistryVotingStorage) GetLatestId added in v1.1.0

func (s *ContractRegistryVotingStorage) GetLatestId() (*int64, error)

GetLatest block.

func (*ContractRegistryVotingStorage) Insert added in v1.1.0

func (*ContractRegistryVotingStorage) Update added in v1.1.0

type DelegationBlockStorage added in v1.1.4

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

func (*DelegationBlockStorage) GetNumber added in v1.1.4

func (s *DelegationBlockStorage) GetNumber() (uint64, error)

func (*DelegationBlockStorage) Update added in v1.1.4

func (s *DelegationBlockStorage) Update(number uint64) error

type DelegationStorage added in v1.1.4

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

func (*DelegationStorage) CountDelegators added in v1.1.4

func (s *DelegationStorage) CountDelegators() (uint64, error)

func (*DelegationStorage) Delete added in v1.1.4

func (s *DelegationStorage) Delete(delegations ...data.Delegation) error

func (*DelegationStorage) Insert added in v1.1.4

func (s *DelegationStorage) Insert(delegations ...data.Delegation) error

type EmergencyUpdateVotingStorage

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

EmergencyUpdateVotingStorage implements data.EmergencyUpdateVotingStorage.

func (*EmergencyUpdateVotingStorage) GetEarliestUnfinishedVotings

func (s *EmergencyUpdateVotingStorage) GetEarliestUnfinishedVotings() ([]data.EmergencyUpdateVoting, error)

func (*EmergencyUpdateVotingStorage) GetLatest

GetLatest block.

func (*EmergencyUpdateVotingStorage) Insert

func (*EmergencyUpdateVotingStorage) Update

type EpdrMembershipVotingStorage

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

EpdrMembershipVotingStorage implements data.EpdrMembershipVotingStorage.

func (*EpdrMembershipVotingStorage) GetEarliestUnfinishedVotings

func (s *EpdrMembershipVotingStorage) GetEarliestUnfinishedVotings() ([]data.EpdrMembershipVoting, error)

func (*EpdrMembershipVotingStorage) GetLatest

GetLatest block.

func (*EpdrMembershipVotingStorage) Insert

func (*EpdrMembershipVotingStorage) Update

type EpdrParametersVotingStorage

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

EpdrParametersVotingStorage implements data.EpdrParametersVotingStorage.

func (*EpdrParametersVotingStorage) GetEarliestUnfinishedVotings

func (s *EpdrParametersVotingStorage) GetEarliestUnfinishedVotings() ([]data.EpdrParametersVoting, error)

func (*EpdrParametersVotingStorage) GetLatest

GetLatest epdr parameters voting.

func (*EpdrParametersVotingStorage) Insert

func (*EpdrParametersVotingStorage) Update

type EpqfiMembershipVotingStorage

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

EpqfiMembershipVotingStorage implements data.EpqfiMembershipVotingStorage.

func (*EpqfiMembershipVotingStorage) GetEarliestUnfinishedVotings

func (s *EpqfiMembershipVotingStorage) GetEarliestUnfinishedVotings() ([]data.EpqfiMembershipVoting, error)

func (*EpqfiMembershipVotingStorage) GetLatest

GetLatest epqfi membership voting.

func (*EpqfiMembershipVotingStorage) Insert

func (*EpqfiMembershipVotingStorage) Update

type EpqfiParametersVotingStorage

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

EpqfiParametersVotingStorage implements data.EpqfiParametersVotingStorage.

func (*EpqfiParametersVotingStorage) GetEarliestUnfinishedVotings

func (s *EpqfiParametersVotingStorage) GetEarliestUnfinishedVotings() ([]data.EpqfiParametersVoting, error)

func (*EpqfiParametersVotingStorage) GetLatest

GetLatest epqfi parameters voting.

func (*EpqfiParametersVotingStorage) Insert

func (*EpqfiParametersVotingStorage) Update

type EprsMembershipVotingStorage

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

EprsMembershipVotingStorage implements data.EprsMembershipVotingStorage.

func (*EprsMembershipVotingStorage) GetEarliestUnfinishedVotings

func (s *EprsMembershipVotingStorage) GetEarliestUnfinishedVotings() ([]data.EprsMembershipVoting, error)

func (*EprsMembershipVotingStorage) GetLatest

GetLatest eprs membership voting.

func (*EprsMembershipVotingStorage) Insert

func (*EprsMembershipVotingStorage) Update

type EprsParametersVotingStorage

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

EprsParametersVotingStorage implements data.EprsParametersVotingStorage.

func (*EprsParametersVotingStorage) GetEarliestUnfinishedVotings

func (s *EprsParametersVotingStorage) GetEarliestUnfinishedVotings() ([]data.EprsParametersVoting, error)

func (*EprsParametersVotingStorage) GetLatest

GetLatest eprs parameters voting.

func (*EprsParametersVotingStorage) Insert

func (*EprsParametersVotingStorage) Update

type GeneralUpdateVotingStorage

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

GeneralUpdateVotingStorage implements data.GeneralUpdateVotingStorage.

func (*GeneralUpdateVotingStorage) GetEarliestUnfinishedVotings

func (s *GeneralUpdateVotingStorage) GetEarliestUnfinishedVotings() ([]data.GeneralUpdateVoting, error)

func (*GeneralUpdateVotingStorage) GetLatest

GetLatest general update voting.

func (*GeneralUpdateVotingStorage) Insert

func (*GeneralUpdateVotingStorage) Update

type PaymentStorage

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

func (*PaymentStorage) Get

func (s *PaymentStorage) Get(txHash string) (*data.Payment, error)

func (*PaymentStorage) Insert

func (s *PaymentStorage) Insert(payments ...data.Payment) error

func (*PaymentStorage) Select

func (s *PaymentStorage) Select(params *data.SelectPaymentsParams) ([]data.Payment, error)

type QTokenHolderVotesStorage added in v1.0.0

type QTokenHolderVotesStorage struct {
	*VotingEventsStorage
}

QTokenHolderVotesStorage implements data.QTokenHolderVotesStorage.

func (*QTokenHolderVotesStorage) SelectAggregated added in v1.0.0

SelectAggregated q token holder aggregated votes with params.

type RootNodeApprovalsStorage added in v1.0.0

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

RootNodeApprovalsStorage implements data.RootNodeApproval.

func (*RootNodeApprovalsStorage) GetLatest added in v1.0.0

func (s *RootNodeApprovalsStorage) GetLatest() (approval *data.RootNodeApproval, err error)

func (*RootNodeApprovalsStorage) Insert added in v1.0.0

func (s *RootNodeApprovalsStorage) Insert(approvals ...data.RootNodeApproval) error

func (*RootNodeApprovalsStorage) Select added in v1.0.0

Select root node approvals with params. SELECT

COALESCE(cycles.first, startCycle) AS first, COALESCE(cycles.last, endCycle) AS last, COALESCE(cycles.signer, nap.main_account) AS signer, COALESCE(cycles.alias, nap.node) AS alias

FROM layer_zero_lists lzl JOIN root_nodes rn ON lzl.id = rn.list_id JOIN node_account_pairs nap ON rn.node = nap.node LEFT JOIN (

SELECT
    MIN(block) as first,
    MAX(block) as last,
    signer,
    alias
FROM approvals
WHERE block BETWEEN startCycle + 1 AND endCycle
GROUP BY signer, alias

) cycles ON LOWER(nap.main_account) = cycles.signer WHERE

nap.active IS TRUE,
lzl.type = 'root-list' AND
lzl.status = 'active' AND (
lzl.timestamp BETWEEN (now() - (endCycle * 5) * interval '1 second') AND (now() - (startCycle * 5) * interval '1 second')
OR
lzl.timestamp = (SELECT MAX(timestamp) FROM layer_zero_lists WHERE type = 'root-list' AND status = 'active'))

ORDER BY signer DESC LIMIT 100;

type RootNodeProposalsStorage added in v1.0.0

type RootNodeProposalsStorage struct {
	*VotingEventsStorage
}

RootNodeProposalsStorage implements data.VoteStorage.

func (*RootNodeProposalsStorage) SelectAggregated added in v1.0.0

SelectAggregated root node aggregated proposals with params.

type RootNodeVotesStorage added in v1.0.0

type RootNodeVotesStorage struct {
	*VotingEventsStorage
}

RootNodeVotesStorage implements data.VoteStorage.

func (*RootNodeVotesStorage) SelectAggregated added in v1.0.0

SelectAggregated root node aggregated votes with params.

type RootnodesSlashingVotingStorage

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

RootnodesSlashingVotingStorage implements data.RootnodesSlashingVotingStorage.

func (*RootnodesSlashingVotingStorage) GetEarliestUnfinishedVotings

func (s *RootnodesSlashingVotingStorage) GetEarliestUnfinishedVotings() ([]data.RootnodesSlashingVoting, error)

func (*RootnodesSlashingVotingStorage) GetLatest

GetLatest rootnodes slashing voting.

func (*RootnodesSlashingVotingStorage) Insert

func (*RootnodesSlashingVotingStorage) Update

type RootsMembershipStorage added in v1.0.0

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

RootsMembershipStorage implements data.RootsVotingStorage.

func (*RootsMembershipStorage) Erase added in v1.0.0

func (s *RootsMembershipStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*RootsMembershipStorage) FindNextPeriodByAddress added in v1.0.0

func (s *RootsMembershipStorage) FindNextPeriodByAddress(rootAddress string, startBlock int64) (*data.RootsMembership, error)

func (*RootsMembershipStorage) GetLatest added in v1.0.0

func (s *RootsMembershipStorage) GetLatest() (*data.RootsMembership, error)

GetLatest roots voting.

func (*RootsMembershipStorage) GetUnfinishedPeriodByAddress added in v1.0.0

func (s *RootsMembershipStorage) GetUnfinishedPeriodByAddress(rootAddress string) (*data.RootsMembership, error)

func (*RootsMembershipStorage) GetUnfinishedPeriods added in v1.0.0

func (s *RootsMembershipStorage) GetUnfinishedPeriods() ([]data.RootsMembership, error)

func (*RootsMembershipStorage) Insert added in v1.0.0

func (s *RootsMembershipStorage) Insert(rnMembership *data.RootsMembership) error

func (*RootsMembershipStorage) Select added in v1.0.0

Select root membership periods with params.

func (*RootsMembershipStorage) SelectActiveRootAddresses added in v1.0.8

func (s *RootsMembershipStorage) SelectActiveRootAddresses() ([]string, error)

func (*RootsMembershipStorage) Update added in v1.0.0

func (s *RootsMembershipStorage) Update(rnMembership *data.RootsMembership) error

type RootsVotingStorage

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

RootsVotingStorage implements data.RootsVotingStorage.

func (*RootsVotingStorage) GetEarliestUnfinishedVotingIds added in v1.0.0

func (s *RootsVotingStorage) GetEarliestUnfinishedVotingIds() ([]uint64, error)

func (*RootsVotingStorage) GetLatest

func (s *RootsVotingStorage) GetLatest() (*data.RootsVoting, error)

GetLatest roots voting.

func (*RootsVotingStorage) Insert

func (s *RootsVotingStorage) Insert(votings ...data.RootsVoting) error

func (*RootsVotingStorage) Update

func (s *RootsVotingStorage) Update(voting *data.RootsVoting) error

type Storage

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

Storage backed by postgres.

func New

func New(db *pgdb.DB) *Storage

New Storage.

func (*Storage) Blocks

func (s *Storage) Blocks() data.BlockStorage

Blocks.

func (*Storage) Clone

func (s *Storage) Clone() data.Storage

Clone Storage for a new tx.

func (*Storage) ConstitutionVotings

func (s *Storage) ConstitutionVotings() data.ConstitutionVotingStorage

ConstitutionVotings storage.

func (*Storage) ContractRegistryAddressVotings

func (s *Storage) ContractRegistryAddressVotings() data.ContractRegistryAddressVotingStorage

ContractRegistryAddressVotings storage.

func (*Storage) ContractRegistryUpgradeVotings

func (s *Storage) ContractRegistryUpgradeVotings() data.ContractRegistryUpgradeVotingStorage

ContractRegistryUpgradeVotings storage.

func (*Storage) ContractRegistryVotings added in v1.1.0

func (s *Storage) ContractRegistryVotings() data.ContractRegistryVotingStorage

ContractRegistryVotings returns a new instance of the querier for contract_registry_votings table

func (*Storage) DelegationBlock added in v1.1.4

func (s *Storage) DelegationBlock() data.DelegationBlocksStorage

func (*Storage) Delegations added in v1.1.4

func (s *Storage) Delegations() data.DelegationsStorage

func (*Storage) EmergencyUpdateVotings

func (s *Storage) EmergencyUpdateVotings() data.EmergencyUpdateVotingStorage

EmergencyUpdateVotings storage.

func (*Storage) EpdrMembershipVotings

func (s *Storage) EpdrMembershipVotings() data.EpdrMembershipVotingStorage

EpdrMembershipVotings storage.

func (*Storage) EpdrParametersVotings

func (s *Storage) EpdrParametersVotings() data.EpdrParametersVotingStorage

EpdrParametersVotings storage.

func (*Storage) EpqfiMembershipVotings

func (s *Storage) EpqfiMembershipVotings() data.EpqfiMembershipVotingStorage

EpqfiMembershipVotings storage.

func (*Storage) EpqfiParametersVotings

func (s *Storage) EpqfiParametersVotings() data.EpqfiParametersVotingStorage

EpqfiParametersVotings storage.

func (*Storage) EprsMembershipVotings

func (s *Storage) EprsMembershipVotings() data.EprsMembershipVotingStorage

EprsMembershipVotings storage.

func (*Storage) EprsParametersVotings

func (s *Storage) EprsParametersVotings() data.EprsParametersVotingStorage

EprsParametersVotings storage.

func (*Storage) ExecInTx

func (s *Storage) ExecInTx(fn func() error) error

ExecInTx isolates execution of fn within sql transaction.

func (*Storage) GeneralUpdateVotings

func (s *Storage) GeneralUpdateVotings() data.GeneralUpdateVotingStorage

GeneralUpdateVotings storage.

func (*Storage) LayerZeroLists added in v1.0.0

func (s *Storage) LayerZeroLists() data.LayerZeroListStorage

LayerZeroLists storage

func (*Storage) Payments

func (s *Storage) Payments() data.PaymentsStorage

Payments storage.

func (*Storage) QTokenHolderVotes added in v1.0.0

func (s *Storage) QTokenHolderVotes() data.QTokenHolderVotesStorage

QTokenHolderVotes storage.

func (*Storage) RootNodeApprovals added in v1.0.0

func (s *Storage) RootNodeApprovals() data.RootNodeApprovalsStorage

RootNodeApprovals storage.

func (*Storage) RootNodeProposals added in v1.0.0

func (s *Storage) RootNodeProposals() data.RootNodeProposalsStorage

RootNodeProposals storage.

func (*Storage) RootNodeVotes added in v1.0.0

func (s *Storage) RootNodeVotes() data.RootNodeVotesStorage

RootNodeVotes storage.

func (*Storage) RootnodesSlashingVotings

func (s *Storage) RootnodesSlashingVotings() data.RootnodesSlashingVotingStorage

RootnodesSlashingVotings storage.

func (*Storage) RootsMembership added in v1.0.0

func (s *Storage) RootsMembership() data.RootsMembershipStorage

RootsMembership storage.

func (*Storage) RootsVotings

func (s *Storage) RootsVotings() data.RootsVotingStorage

RootsVotings storage.

func (*Storage) SummaryMetrics

func (s *Storage) SummaryMetrics() data.SummaryMetricsStorage

SummaryMetrics.

func (*Storage) SystemContracts added in v1.0.0

func (s *Storage) SystemContracts() data.SystemContractsStorage

SystemContracts storage.

func (*Storage) Transactions

func (s *Storage) Transactions() data.TransactionStorage

Transactions.

func (*Storage) ValidatorsSlashingVotings

func (s *Storage) ValidatorsSlashingVotings() data.ValidatorsSlashingVotingStorage

ValidatorsSlashingVotings storage.

func (*Storage) Variables added in v1.0.0

func (s *Storage) Variables() data.VariableStorage

Variables storage.

func (*Storage) VotingAgents added in v1.0.0

func (s *Storage) VotingAgents() data.VotingAgentStorage

VotingAgents storage.

func (*Storage) Votings

func (s *Storage) Votings() data.VotingStorage

Payments storage.

type SummaryMetricsStorage

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

SummaryMetricsStorage implements data.SummaryMetricsStorage.

func (*SummaryMetricsStorage) Select

Select blocks with params. The SQL query: WITH block_metrics AS (

SELECT
    MAX(id) - 1000*101 + 1 AS min_block,
    MAX(id) AS max_block
FROM blocks

), calculations AS (

	SELECT
	    b.mainaccount AS main_account,
	    SUM(CASE WHEN b.signer = b.inturn_signer THEN 1 ELSE 0 END) AS total_inturn_blocks,
	    (select count(bk.inturn_signer) from blocks bk where bk.inturn_signer = b.signer) AS total_due_blocks,
     count(b.signer) as total_produced,
	    b.signer AS signer
	FROM blocks b
	WHERE b.id BETWEEN (SELECT min_block FROM block_metrics) AND (SELECT max_block FROM block_metrics)
	GROUP BY b.mainaccount, b.signer

) SELECT

	main_account,
	signer,
	total_inturn_blocks,
	total_due_blocks,
	total_produced-total_inturn_blocks AS total_outofturn_blocks,
	CASE
	    WHEN total_due_blocks = 0 THEN 0
	    ELSE total_inturn_blocks::float / total_due_blocks
    END AS availability

FROM calculations;

type TransactionStorage

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

func (*TransactionStorage) Get

func (s *TransactionStorage) Get(hash string) (*data.Transaction, error)

Get Transaction by hash.

func (*TransactionStorage) Insert

func (s *TransactionStorage) Insert(txs ...data.Transaction) error

Insert txs.

func (*TransactionStorage) Select

func (s *TransactionStorage) Select(params *data.SelectTxsParams) ([]data.Transaction, error)

Select txs.

type ValidatorsSlashingVotingStorage

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

ValidatorsSlashingVotingStorage implements data.ValidatorsSlashingVotingStorage.

func (*ValidatorsSlashingVotingStorage) GetEarliestUnfinishedVotings

func (s *ValidatorsSlashingVotingStorage) GetEarliestUnfinishedVotings() ([]data.ValidatorsSlashingVoting, error)

func (*ValidatorsSlashingVotingStorage) GetLatest

GetLatest validators slashing voting.

func (*ValidatorsSlashingVotingStorage) Insert

func (*ValidatorsSlashingVotingStorage) Update

type VariableStorage added in v1.0.0

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

VariableStorage implements data.VariableStorage.

func (*VariableStorage) Erase added in v1.0.0

func (s *VariableStorage) Erase(name string) error

Erase all history starting fromID inclusively.

func (*VariableStorage) GetByName added in v1.0.0

func (s *VariableStorage) GetByName(name string) (*data.Variable, error)

func (*VariableStorage) Insert added in v1.0.0

func (s *VariableStorage) Insert(variable *data.Variable) error

func (*VariableStorage) Update added in v1.0.0

func (s *VariableStorage) Update(variable *data.Variable) error

type VotingAgentStorage added in v1.0.0

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

VotingAgentStorage implements data.VotingAgent.

func (*VotingAgentStorage) GetByVotingAgents added in v1.0.0

func (s *VotingAgentStorage) GetByVotingAgents(address ...string) ([]data.VotingAgent, error)

func (*VotingAgentStorage) GetLatestBlock added in v1.0.0

func (s *VotingAgentStorage) GetLatestBlock() (int64, error)

func (*VotingAgentStorage) Insert added in v1.0.0

func (s *VotingAgentStorage) Insert(agents ...data.VotingAgent) error

type VotingEventsStorage added in v1.0.0

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

VotingEventsStorage implements data.VotingEvent.

func (*VotingEventsStorage) Erase added in v1.0.0

func (s *VotingEventsStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*VotingEventsStorage) GetByLatestByType added in v1.0.0

func (s *VotingEventsStorage) GetByLatestByType(votingType string) (*data.VotingEvent, error)

func (*VotingEventsStorage) Insert added in v1.0.0

func (s *VotingEventsStorage) Insert(votingEvents ...data.VotingEvent) error

func (*VotingEventsStorage) Select added in v1.0.0

func (s *VotingEventsStorage) Select(params data.SelectVotingEventsParams, addresses []string) ([]data.VotingEvent, error)

Select current onchain root nodes votes with params.

type VotingStorage

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

VotingStorage implements all votings from package data.

func (*VotingStorage) Select

func (s *VotingStorage) Select(
	params *data.SelectVotingsParams,
	currentRootNodesCount uint64,
) ([]data.GeneralVoting, error)

Select blocks with params.

func (*VotingStorage) Union

func (s *VotingStorage) Union(mainQuery *squirrel.SelectBuilder, query squirrel.SelectBuilder) error

Jump to

Keyboard shortcuts

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