data

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigInt

type BigInt big.Int

BigInt is a wrapper for saving to db.

func NewBigInt

func NewBigInt(b *big.Int) *BigInt

NewBigInt.

func (*BigInt) Scan

func (b *BigInt) Scan(src interface{}) error

Scan implements sql.Scanner interface.

func (*BigInt) Unwrap

func (b *BigInt) Unwrap() *big.Int

Unwrap returns underlying big.Int

func (BigInt) Value

func (b BigInt) Value() (driver.Value, error)

Value implements driver.Valuer.

type Block

type Block struct {
	Number       uint64 `db:"id"`
	Hash         string `db:"hash"`
	Parent       string `db:"parent"`
	Signer       string `db:"signer"`
	MainAccount  string `db:"mainaccount"`
	Timestamp    int64  `db:"timestamp"`
	InTurnSigner string `db:"inturn_signer"`
	Difficulty   int64  `db:"difficulty"`
}

Block of txs.

type BlockStorage

type BlockStorage interface {
	Insert(block *Block) error
	GetByNumber(number uint64) (*Block, error)
	GetLatest() (*Block, error)
	GetBlockEarlierThan(timestamp int64) (*Block, error)

	Select(params *SelectBlocksParams) ([]Block, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

BlockStorage stores blocks.

type ConstitutionVoting

type ConstitutionVoting struct {
	ProposalId      uint64 `db:"proposal_id"`
	VotingType      string `db:"voting_type"`
	VotingSubType   uint8  `db:"voting_subtype"`
	VotingStatus    uint8  `db:"voting_status"`
	VotingStartTime int64  `db:"voting_start_time"`
	CurrentQuorum   string `db:"current_quorum"`
	RequiredQuorum  string `db:"required_quorum"`
	VotingEndTime   int64  `db:"voting_end_time"`
	VetoEndTime     int64  `db:"veto_end_time"`
}

ConstitutionVoting voting.

type ConstitutionVotingStorage

type ConstitutionVotingStorage interface {
	Insert(voting *ConstitutionVoting) error
	GetByNumber(number uint64) (*ConstitutionVoting, error)
	GetLatest() (*ConstitutionVoting, error)

	GetEarliestUnfinishedVotings() ([]ConstitutionVoting, error)
	Update(voting *ConstitutionVoting) error

	Select(params *SelectConstitutionVotingParams) ([]ConstitutionVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

ConstitutionVotingStorage stores constitution votings.

type ContractRegistryAddressVoting

type ContractRegistryAddressVoting struct {
	ProposalId       uint64 `db:"proposal_id"`
	VotingType       string `db:"voting_type"`
	VotingStatus     uint8  `db:"voting_status"`
	VotingStartTime  int64  `db:"voting_start_time"`
	CurrentMajority  string `db:"current_majority"`
	RequiredMajority string `db:"required_majority"`
	VotingEndTime    int64  `db:"voting_end_time"`
}

ContractRegistryAddressVoting voting.

type ContractRegistryAddressVotingStorage

type ContractRegistryAddressVotingStorage interface {
	Insert(voting *ContractRegistryAddressVoting) error
	GetByNumber(number uint64) (*ContractRegistryAddressVoting, error)
	GetLatest() (*ContractRegistryAddressVoting, error)

	GetEarliestUnfinishedVotings() ([]ContractRegistryAddressVoting, error)
	Update(voting *ContractRegistryAddressVoting) error

	Select(params *SelectContractRegistryAddressVotingParams) ([]ContractRegistryAddressVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

ContractRegistryAddressVotingStorage stores contract registry upgrade votings.

type ContractRegistryUpgradeVoting

type ContractRegistryUpgradeVoting struct {
	ProposalId       uint64 `db:"proposal_id"`
	VotingType       string `db:"voting_type"`
	VotingStatus     uint8  `db:"voting_status"`
	VotingStartTime  int64  `db:"voting_start_time"`
	CurrentMajority  string `db:"current_majority"`
	RequiredMajority string `db:"required_majority"`
	VotingEndTime    int64  `db:"voting_end_time"`
}

ContractRegistryUpgradeVoting voting.

type ContractRegistryUpgradeVotingStorage

type ContractRegistryUpgradeVotingStorage interface {
	Insert(voting *ContractRegistryUpgradeVoting) error
	GetByNumber(number uint64) (*ContractRegistryUpgradeVoting, error)
	GetLatest() (*ContractRegistryUpgradeVoting, error)

	GetEarliestUnfinishedVotings() ([]ContractRegistryUpgradeVoting, error)
	Update(voting *ContractRegistryUpgradeVoting) error

	Select(params *SelectContractRegistryUpgradeVotingParams) ([]ContractRegistryUpgradeVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

ContractRegistryUpgradeVotingStorage stores contract registry upgrade votings.

type EmergencyUpdateVoting

type EmergencyUpdateVoting struct {
	ProposalId      uint64 `db:"proposal_id"`
	VotingType      string `db:"voting_type"`
	VotingStatus    uint8  `db:"voting_status"`
	VotingStartTime int64  `db:"voting_start_time"`
	CurrentQuorum   string `db:"current_quorum"`
	RequiredQuorum  string `db:"required_quorum"`
	VotingEndTime   int64  `db:"voting_end_time"`
	VetoEndTime     int64  `db:"veto_end_time"`
}

EmergencyUpdateVoting voting.

type EmergencyUpdateVotingStorage

type EmergencyUpdateVotingStorage interface {
	Insert(voting *EmergencyUpdateVoting) error
	GetByNumber(number uint64) (*EmergencyUpdateVoting, error)
	GetLatest() (*EmergencyUpdateVoting, error)

	GetEarliestUnfinishedVotings() ([]EmergencyUpdateVoting, error)
	Update(voting *EmergencyUpdateVoting) error

	Select(params *SelectEmergencyUpdateVotingParams) ([]EmergencyUpdateVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

EmergencyUpdateVotingStorage stores emergency update votings.

type EpdrMembershipVoting

type EpdrMembershipVoting struct {
	ProposalId      uint64 `db:"proposal_id"`
	VotingType      string `db:"voting_type"`
	VotingStatus    uint8  `db:"voting_status"`
	VotingStartTime int64  `db:"voting_start_time"`
	CurrentQuorum   string `db:"current_quorum"`
	RequiredQuorum  string `db:"required_quorum"`
	VotingEndTime   int64  `db:"voting_end_time"`
	VetoEndTime     int64  `db:"veto_end_time"`
}

EpdrMembershipVoting voting.

type EpdrMembershipVotingStorage

type EpdrMembershipVotingStorage interface {
	Insert(voting *EpdrMembershipVoting) error
	GetByNumber(number uint64) (*EpdrMembershipVoting, error)
	GetLatest() (*EpdrMembershipVoting, error)

	GetEarliestUnfinishedVotings() ([]EpdrMembershipVoting, error)
	Update(voting *EpdrMembershipVoting) error

	Select(params *SelectEpdrMembershipVotingParams) ([]EpdrMembershipVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

EpdrMembershipVotingStorage stores epdr membership votings.

type EpdrParametersVoting

type EpdrParametersVoting struct {
	ProposalId      uint64 `db:"proposal_id"`
	VotingType      string `db:"voting_type"`
	VotingStatus    uint8  `db:"voting_status"`
	VotingStartTime int64  `db:"voting_start_time"`
	CurrentQuorum   string `db:"current_quorum"`
	RequiredQuorum  string `db:"required_quorum"`
	VotingEndTime   int64  `db:"voting_end_time"`
	VetoEndTime     int64  `db:"veto_end_time"`
}

EpdrParametersVoting voting.

type EpdrParametersVotingStorage

type EpdrParametersVotingStorage interface {
	Insert(voting *EpdrParametersVoting) error
	GetByNumber(number uint64) (*EpdrParametersVoting, error)
	GetLatest() (*EpdrParametersVoting, error)

	GetEarliestUnfinishedVotings() ([]EpdrParametersVoting, error)
	Update(voting *EpdrParametersVoting) error

	Select(params *SelectEpdrParametersVotingParams) ([]EpdrParametersVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

EpdrParametersVotingStorage stores epdr parameters votings.

type EpqfiMembershipVoting

type EpqfiMembershipVoting struct {
	ProposalId      uint64 `db:"proposal_id"`
	VotingType      string `db:"voting_type"`
	VotingStatus    uint8  `db:"voting_status"`
	VotingStartTime int64  `db:"voting_start_time"`
	CurrentQuorum   string `db:"current_quorum"`
	RequiredQuorum  string `db:"required_quorum"`
	VotingEndTime   int64  `db:"voting_end_time"`
	VetoEndTime     int64  `db:"veto_end_time"`
}

EpqfiMembershipVoting voting.

type EpqfiMembershipVotingStorage

type EpqfiMembershipVotingStorage interface {
	Insert(voting *EpqfiMembershipVoting) error
	GetByNumber(number uint64) (*EpqfiMembershipVoting, error)
	GetLatest() (*EpqfiMembershipVoting, error)

	GetEarliestUnfinishedVotings() ([]EpqfiMembershipVoting, error)
	Update(voting *EpqfiMembershipVoting) error

	Select(params *SelectEpqfiMembershipVotingParams) ([]EpqfiMembershipVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

EpqfiMembershipVotingStorage stores epqfi membership votings.

type EpqfiParametersVoting

type EpqfiParametersVoting struct {
	ProposalId      uint64 `db:"proposal_id"`
	VotingType      string `db:"voting_type"`
	VotingStatus    uint8  `db:"voting_status"`
	VotingStartTime int64  `db:"voting_start_time"`
	CurrentQuorum   string `db:"current_quorum"`
	RequiredQuorum  string `db:"required_quorum"`
	VotingEndTime   int64  `db:"voting_end_time"`
	VetoEndTime     int64  `db:"veto_end_time"`
}

EpqfiParametersVoting voting.

type EpqfiParametersVotingStorage

type EpqfiParametersVotingStorage interface {
	Insert(voting *EpqfiParametersVoting) error
	GetByNumber(number uint64) (*EpqfiParametersVoting, error)
	GetLatest() (*EpqfiParametersVoting, error)

	GetEarliestUnfinishedVotings() ([]EpqfiParametersVoting, error)
	Update(voting *EpqfiParametersVoting) error

	Select(params *SelectEpqfiParametersVotingParams) ([]EpqfiParametersVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

EpqfiParametersVotingStorage stores epqfi parameters votings.

type EprsMembershipVoting

type EprsMembershipVoting struct {
	ProposalId      uint64 `db:"proposal_id"`
	VotingType      string `db:"voting_type"`
	VotingStatus    uint8  `db:"voting_status"`
	VotingStartTime int64  `db:"voting_start_time"`
	CurrentQuorum   string `db:"current_quorum"`
	RequiredQuorum  string `db:"required_quorum"`
	VotingEndTime   int64  `db:"voting_end_time"`
	VetoEndTime     int64  `db:"veto_end_time"`
}

EprsMembershipVoting voting.

type EprsMembershipVotingStorage

type EprsMembershipVotingStorage interface {
	Insert(voting *EprsMembershipVoting) error
	GetByNumber(number uint64) (*EprsMembershipVoting, error)
	GetLatest() (*EprsMembershipVoting, error)

	GetEarliestUnfinishedVotings() ([]EprsMembershipVoting, error)
	Update(voting *EprsMembershipVoting) error

	Select(params *SelectEprsMembershipVotingParams) ([]EprsMembershipVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

EprsMembershipVotingStorage stores eprs membership votings.

type EprsParametersVoting

type EprsParametersVoting struct {
	ProposalId      uint64 `db:"proposal_id"`
	VotingType      string `db:"voting_type"`
	VotingStatus    uint8  `db:"voting_status"`
	VotingStartTime int64  `db:"voting_start_time"`
	CurrentQuorum   string `db:"current_quorum"`
	RequiredQuorum  string `db:"required_quorum"`
	VotingEndTime   int64  `db:"voting_end_time"`
	VetoEndTime     int64  `db:"veto_end_time"`
}

EprsParametersVoting voting.

type EprsParametersVotingStorage

type EprsParametersVotingStorage interface {
	Insert(voting *EprsParametersVoting) error
	GetByNumber(number uint64) (*EprsParametersVoting, error)
	GetLatest() (*EprsParametersVoting, error)

	GetEarliestUnfinishedVotings() ([]EprsParametersVoting, error)
	Update(voting *EprsParametersVoting) error

	Select(params *SelectEprsParametersVotingParams) ([]EprsParametersVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

EprsParametersVotingStorage stores eprs parameters votings.

type GeneralUpdateVoting

type GeneralUpdateVoting struct {
	ProposalId      uint64 `db:"proposal_id"`
	VotingType      string `db:"voting_type"`
	VotingStatus    uint8  `db:"voting_status"`
	VotingStartTime int64  `db:"voting_start_time"`
	CurrentQuorum   string `db:"current_quorum"`
	RequiredQuorum  string `db:"required_quorum"`
	VotingEndTime   int64  `db:"voting_end_time"`
	VetoEndTime     int64  `db:"veto_end_time"`
}

GeneralUpdateVoting voting.

type GeneralUpdateVotingStorage

type GeneralUpdateVotingStorage interface {
	Insert(voting *GeneralUpdateVoting) error
	GetByNumber(number uint64) (*GeneralUpdateVoting, error)
	GetLatest() (*GeneralUpdateVoting, error)

	GetEarliestUnfinishedVotings() ([]GeneralUpdateVoting, error)
	Update(voting *GeneralUpdateVoting) error

	Select(params *SelectGeneralUpdateVotingParams) ([]GeneralUpdateVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

GeneralUpdateVotingStorage stores general update votings.

type MetricsByMiner

type MetricsByMiner struct {
	DueBlocks       uint64 `db:"dueblocks"`
	InTurnBlocks    uint64 `db:"inturnblocks"`
	OutOfTurnBlocks uint64 `db:"outofturnblocks"`
}

type Payment

type Payment struct {
	TxHash    string  `db:"tx_hash"`
	Sender    string  `db:"sender"`
	Recipient string  `db:"recipient"`
	Value     *BigInt `db:"value"`

	Token *string `db:"token"`

	Timestamp int64 `db:"timestamp"`

	// comes from 'includes', not from db
	Tx *Transaction
}

type PaymentsStorage

type PaymentsStorage interface {
	Insert(payments ...Payment) error
	Select(params *SelectPaymentsParams) ([]Payment, error)
}

type RootnodesSlashingVoting

type RootnodesSlashingVoting struct {
	ProposalId      uint64 `db:"proposal_id"`
	VotingType      string `db:"voting_type"`
	VotingStatus    uint8  `db:"voting_status"`
	VotingStartTime int64  `db:"voting_start_time"`
	CurrentQuorum   string `db:"current_quorum"`
	RequiredQuorum  string `db:"required_quorum"`
	VotingEndTime   int64  `db:"voting_end_time"`
	VetoEndTime     int64  `db:"veto_end_time"`
}

RootnodesSlashingVoting voting.

type RootnodesSlashingVotingStorage

type RootnodesSlashingVotingStorage interface {
	Insert(voting *RootnodesSlashingVoting) error
	GetByNumber(number uint64) (*RootnodesSlashingVoting, error)
	GetLatest() (*RootnodesSlashingVoting, error)

	GetEarliestUnfinishedVotings() ([]RootnodesSlashingVoting, error)
	Update(voting *RootnodesSlashingVoting) error

	Select(params *SelectRootnodesSlashingVotingParams) ([]RootnodesSlashingVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

RootnodesSlashingVotingStorage stores rootnodes slashing votings.

type RootsVoting

type RootsVoting struct {
	ProposalId      uint64 `db:"proposal_id"`
	VotingType      string `db:"voting_type"`
	VotingStatus    uint8  `db:"voting_status"`
	VotingStartTime int64  `db:"voting_start_time"`
	CurrentQuorum   string `db:"current_quorum"`
	RequiredQuorum  string `db:"required_quorum"`
	VotingEndTime   int64  `db:"voting_end_time"`
	VetoEndTime     int64  `db:"veto_end_time"`
	Candidate       string `db:"candidate"`
	ReplaceDest     string `db:"replace_dest"`
}

RootsVoting voting.

type RootsVotingStorage

type RootsVotingStorage interface {
	Insert(voting *RootsVoting) error
	GetByNumber(number uint64) (*RootsVoting, error)
	GetLatest() (*RootsVoting, error)

	GetEarliestUnfinishedVotings() ([]RootsVoting, error)
	Update(voting *RootsVoting) error

	Select(params *SelectRootsVotingParams) ([]RootsVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

RootsVotingStorage stores roots votings.

type SelectBlocksParams

type SelectBlocksParams struct {
	IsDesc bool
	Cursor *uint64
	Limit  uint64

	From *uint64
	To   *uint64

	Signer       *string
	MainAccount  *string
	InTurnSigner *string
	AnySigner    *string
	OutOfTurn    bool
}

type SelectConstitutionVotingParams

type SelectConstitutionVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	SubType []uint8
	Status  []string
}

type SelectContractRegistryAddressVotingParams

type SelectContractRegistryAddressVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectContractRegistryUpgradeVotingParams

type SelectContractRegistryUpgradeVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectEmergencyUpdateVotingParams

type SelectEmergencyUpdateVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectEpdrMembershipVotingParams

type SelectEpdrMembershipVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectEpdrParametersVotingParams

type SelectEpdrParametersVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectEpqfiMembershipVotingParams

type SelectEpqfiMembershipVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectEpqfiParametersVotingParams

type SelectEpqfiParametersVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectEprsMembershipVotingParams

type SelectEprsMembershipVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectEprsParametersVotingParams

type SelectEprsParametersVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectGeneralUpdateVotingParams

type SelectGeneralUpdateVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectPaymentsParams

type SelectPaymentsParams struct {
	Cursor *string
	Limit  uint64
	IsDesc bool

	Sender    *string
	Recipient *string

	// Counterparty is either Sender or Recipient
	// and mutually exclusive to those filters
	Counterparty *string

	Token    *string
	IsNative *bool
}

type SelectRootnodesSlashingVotingParams

type SelectRootnodesSlashingVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectRootsVotingParams

type SelectRootsVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectSummaryMetricsParams

type SelectSummaryMetricsParams struct {
	IsDesc bool
	Cursor *uint64
	Limit  uint64

	Cycles      uint64
	Signer      *string
	MainAccount *string
}

type SelectTxsParams

type SelectTxsParams struct {
	Cursor *string
	Limit  uint64
	IsDesc bool

	Sender    *string
	Recipient *string

	// Counterparty is either Sender or Recipient
	// and mutually exclusive to those filters
	Counterparty *string
}

SelectTxsParams.

type SelectValidatorsSlashingVotingParams

type SelectValidatorsSlashingVotingParams struct {
	IsDesc bool
	Cursor *int64
	Limit  uint64

	From *uint64
	To   *uint64

	Status []string
}

type SelectVotingsParams

type SelectVotingsParams struct {
	IsDesc bool
	Cursor *uint64
	Limit  uint64

	Type     string
	Status   []string
	Finished *bool
}

type Storage

type Storage interface {
	Clone() Storage
	ExecInTx(fn func() error) error

	Blocks() BlockStorage
	Transactions() TransactionStorage
	Payments() PaymentsStorage

	Votings() VotingStorage
	ConstitutionVotings() ConstitutionVotingStorage
	GeneralUpdateVotings() GeneralUpdateVotingStorage
	EmergencyUpdateVotings() EmergencyUpdateVotingStorage
	RootsVotings() RootsVotingStorage
	RootnodesSlashingVotings() RootnodesSlashingVotingStorage
	ValidatorsSlashingVotings() ValidatorsSlashingVotingStorage
	EpqfiMembershipVotings() EpqfiMembershipVotingStorage
	EpqfiParametersVotings() EpqfiParametersVotingStorage
	EpdrMembershipVotings() EpdrMembershipVotingStorage
	EpdrParametersVotings() EpdrParametersVotingStorage
	EprsMembershipVotings() EprsMembershipVotingStorage
	EprsParametersVotings() EprsParametersVotingStorage
	ContractRegistryAddressVotings() ContractRegistryAddressVotingStorage
	ContractRegistryUpgradeVotings() ContractRegistryUpgradeVotingStorage
}

Storage.

type SummaryMetrics

type SummaryMetrics struct {
	Number               uint64                    `db:"id"`
	MainAccount          string                    `db:"mainaccount"`
	TotalDueBlocks       uint64                    `db:"totaldueblocks"`
	TotalInTurnBlocks    uint64                    `db:"totalinturnblocks"`
	TotalOutOfTurnBlocks uint64                    `db:"totaloutofturnblocks"`
	MetricsByMiner       map[string]MetricsByMiner `db:"metricsbyminer"`
}

Block of summary of metrics.

type SummaryMetricsStorage

type SummaryMetricsStorage interface {
	Select(params *SelectSummaryMetricsParams) ([]SummaryMetrics, error)
}

SummaryMetricsStorage stores blocks.

type SummaryQuery

type SummaryQuery struct {
	MainAccount          string  `db:"main_account"`
	Signer               string  `db:"signer"`
	TotalDueBlocks       uint64  `db:"total_due_blocks"`
	TotalInTurnBlocks    uint64  `db:"total_inturn_blocks"`
	TotalOutOfTurnBlocks uint64  `db:"total_outofturn_blocks"`
	Availability         float64 `db:"availability"`
}

type Transaction

type Transaction struct {
	Hash      string  `db:"hash"`
	Block     uint64  `db:"block_id"`
	Sender    string  `db:"sender"`
	Recipient *string `db:"recipient"`
	Value     *BigInt `db:"value"`

	Nonce    uint64  `db:"nonce"`
	GasPrice *BigInt `db:"gas_price"`
	Gas      uint64  `db:"gas"`
	Input    []byte  `db:"input"`

	Timestamp int64 `db:"timestamp"`
}

Transaction.

type TransactionStorage

type TransactionStorage interface {
	Insert(txs ...Transaction) error
	Get(hash string) (*Transaction, error)
	Select(params *SelectTxsParams) ([]Transaction, error)
}

TransactionStorage.

type ValidatorsSlashingVoting

type ValidatorsSlashingVoting struct {
	ProposalId      uint64 `db:"proposal_id"`
	VotingType      string `db:"voting_type"`
	VotingStatus    uint8  `db:"voting_status"`
	VotingStartTime int64  `db:"voting_start_time"`
	CurrentQuorum   string `db:"current_quorum"`
	RequiredQuorum  string `db:"required_quorum"`
	VotingEndTime   int64  `db:"voting_end_time"`
	VetoEndTime     int64  `db:"veto_end_time"`
}

ValidatorsSlashingVoting voting.

type ValidatorsSlashingVotingStorage

type ValidatorsSlashingVotingStorage interface {
	Insert(voting *ValidatorsSlashingVoting) error
	GetByNumber(number uint64) (*ValidatorsSlashingVoting, error)
	GetLatest() (*ValidatorsSlashingVoting, error)

	GetEarliestUnfinishedVotings() ([]ValidatorsSlashingVoting, error)
	Update(voting *ValidatorsSlashingVoting) error

	Select(params *SelectValidatorsSlashingVotingParams) ([]ValidatorsSlashingVoting, error)

	// Erase all history starting fromID inclusively.
	Erase(fromID uint64) error
}

ValidatorsSlashingVotingStorage stores validators slashing votings.

type Voting

type Voting struct {
	ProposalId    uint64 `json:"proposal_id" db:"proposal_id"`
	VotingType    string `json:"voting_type" db:"voting_type"`
	VotingStatus  uint8  `json:"voting_status" db:"voting_status"`
	VotingEndTime int64  `json:"voting_end_time" db:"voting_end_time"`
}

type VotingStorage

type VotingStorage interface {
	Select(params *SelectVotingsParams) ([]interface{}, error)
}

VotingsStorage stores votings.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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