Documentation ¶
Index ¶
- Variables
- func Builder(ctx *db.Context) (db.Database, error)
- type Db
- func (db *Db) DeleteFeeGrantAllowance(allowance types.GrantRemoval) error
- func (db *Db) GetAccounts() ([]string, error)
- func (db *Db) GetBlockHeightTimeDayAgo(now time.Time) (dbtypes.BlockRow, error)
- func (db *Db) GetBlockHeightTimeHourAgo(now time.Time) (dbtypes.BlockRow, error)
- func (db *Db) GetBlockHeightTimeMinuteAgo(now time.Time) (dbtypes.BlockRow, error)
- func (db *Db) GetGenesis() (*types.Genesis, error)
- func (db *Db) GetGovParams() (*types.GovParams, error)
- func (db *Db) GetItem(index string) (*types.Item, error)
- func (db *Db) GetLastBlock() (*dbtypes.BlockRow, error)
- func (db *Db) GetLastBlockHeight() (int64, error)
- func (db *Db) GetOpenProposalsIds(blockHeight uint64) ([]uint64, error)
- func (db *Db) GetOperation(index string) (*types.Operation, error)
- func (db *Db) GetProposal(id uint64) (*types.Proposal, error)
- func (db *Db) GetStakingParams() (*types.StakingParams, error)
- func (db *Db) GetTokensPriceID() ([]string, error)
- func (db *Db) GetValidator(valAddress string) (types.Validator, error)
- func (db *Db) GetValidatorBySelfDelegateAddress(address string) (types.Validator, error)
- func (db *Db) GetValidatorConsensusAddress(address string) (sdk.ConsAddress, error)
- func (db *Db) GetValidatorOperatorAddress(consAddr string) (sdk.ValAddress, error)
- func (db *Db) GetValidators() ([]types.Validator, error)
- func (db *Db) InsertEnableModules(modules []string) error
- func (db *Db) Prune(height int64) error
- func (db *Db) RemoveCollection(indexKey []byte) error
- func (db *Db) RemoveCollectionData(indexKey []byte) error
- func (db *Db) RemoveCollectionDataByCollection(collection string) error
- func (db *Db) RemoveItem(index string) error
- func (db *Db) RemoveOnChainItems(itemIndex string) error
- func (db *Db) RemoveRarimoCoreVotes(opIndex string) error
- func (db *Db) RemoveSeed(seed string) error
- func (db *Db) SaveAccounts(accounts []types.Account) error
- func (db *Db) SaveAverageBlockTimeGenesis(averageTime float64, height int64) error
- func (db *Db) SaveAverageBlockTimePerDay(averageTime float64, height int64) error
- func (db *Db) SaveAverageBlockTimePerHour(averageTime float64, height int64) error
- func (db *Db) SaveAverageBlockTimePerMin(averageTime float64, height int64) error
- func (db *Db) SaveBridgeParams(params *types.BridgeParams) (err error)
- func (db *Db) SaveChangeParties(changeParties []types.ChangeParties) (err error)
- func (db *Db) SaveCollectionDatas(collectionDatas []types.CollectionData) error
- func (db *Db) SaveCollections(collections []types.Collection) error
- func (db *Db) SaveCommunityPool(coin sdk.DecCoins, height int64) error
- func (db *Db) SaveConfirmations(confirmations []types.Confirmation) (err error)
- func (db *Db) SaveContractUpgrades(contractUpgrades []types.ContractUpgrade) (err error)
- func (db *Db) SaveDeposits(deposits []types.Deposit) error
- func (db *Db) SaveDistributionParams(params *types.DistributionParams) error
- func (db *Db) SaveDoubleSignEvidence(evidence types.DoubleSignEvidence) error
- func (db *Db) SaveFeeGrantAllowance(allowance types.FeeGrant) error
- func (db *Db) SaveFeeTokenManagements(managements []types.FeeTokenManagement) (err error)
- func (db *Db) SaveGenesis(genesis *types.Genesis) error
- func (db *Db) SaveGenesisGovParams(params *types.GenesisGovParams) error
- func (db *Db) SaveGovParams(params *types.GovParams) error
- func (db *Db) SaveGroups(groups []*types.Group) (err error)
- func (db *Db) SaveHashes(hashes []types.Hash) error
- func (db *Db) SaveIdentityDefaultTransfers(transfers []types.IdentityDefaultTransfer) (err error)
- func (db *Db) SaveIdentityGISTTransfers(transfers []types.IdentityGISTTransfer) (err error)
- func (db *Db) SaveIdentityStateTransfers(transfers []types.IdentityStateTransfer) (err error)
- func (db *Db) SaveItems(items []types.Item) error
- func (db *Db) SaveMintParams(params *types.MintParams) error
- func (db *Db) SaveMultisigParams(params *types.MultisigParams) (err error)
- func (db *Db) SaveMultisigProposalVotes(votes []*types.MultisigProposalVote) (err error)
- func (db *Db) SaveMultisigProposals(proposals []*types.MultisigProposal) (err error)
- func (db *Db) SaveNetworks(networks []types.Network) (err error)
- func (db *Db) SaveOnChainItems(items []types.OnChainItem) error
- func (db *Db) SaveOperations(operations []types.Operation) error
- func (db *Db) SaveOracleManagerParams(params *types.OracleManagerParams) (err error)
- func (db *Db) SaveOracles(oracles []types.Oracle) error
- func (db *Db) SaveParties(parties []types.Party) error
- func (db *Db) SaveProposalStakingPoolSnapshot(snapshot types.ProposalStakingPoolSnapshot) error
- func (db *Db) SaveProposalValidatorsStatusesSnapshots(snapshots []types.ProposalValidatorStatusSnapshot) error
- func (db *Db) SaveProposals(proposals []types.Proposal) error
- func (db *Db) SaveRarimoCoreParams(params *types.RarimoCoreParams) (err error)
- func (db *Db) SaveRarimoCoreVotes(votes []types.RarimoCoreVote) (err error)
- func (db *Db) SaveSeeds(seeds []types.Seed) error
- func (db *Db) SaveSlashingParams(params *types.SlashingParams) error
- func (db *Db) SaveStakingParams(params types.StakingParams) error
- func (db *Db) SaveStakingPool(pool *types.Pool) error
- func (db *Db) SaveSupply(coins sdk.Coins, height int64) error
- func (db *Db) SaveTallyResults(tallys []types.TallyResult) error
- func (db *Db) SaveToken(token types.Token) error
- func (db *Db) SaveTokenPricesHistory(prices []types.TokenPrice) error
- func (db *Db) SaveTokensPrices(prices []types.TokenPrice) error
- func (db *Db) SaveTransfers(transfers []types.Transfer) (err error)
- func (db *Db) SaveValidatorCommission(data types.ValidatorCommission) error
- func (db *Db) SaveValidatorData(validator types.Validator) error
- func (db *Db) SaveValidatorDescription(description types.ValidatorDescription) error
- func (db *Db) SaveValidatorsData(validators []types.Validator) error
- func (db *Db) SaveValidatorsSigningInfos(infos []types.ValidatorSigningInfo) error
- func (db *Db) SaveValidatorsStatuses(statuses []types.ValidatorStatus) error
- func (db *Db) SaveValidatorsVotingPowers(entries []types.ValidatorVotingPower) error
- func (db *Db) SaveVestingAccounts(vestingAccounts []exported.VestingAccount) error
- func (db *Db) SaveViolationReports(reports []types.ViolationReport) (err error)
- func (db *Db) SaveVote(vote types.Vote) error
- func (db *Db) StoreBaseVestingAccountFromMsg(bva *vestingtypes.BaseVestingAccount, txTimestamp time.Time) error
- func (db *Db) UpdateChangeParties(changeParties types.ChangeParties) (err error)
- func (db *Db) UpdateCollection(collection types.Collection) error
- func (db *Db) UpdateCollectionData(data types.CollectionData) error
- func (db *Db) UpdateOperation(operation types.Operation) error
- func (db *Db) UpdateProposal(update types.ProposalUpdate) error
- func (db *Db) UpsertItem(item types.Item) error
- func (db *Db) UpsertSeed(seed types.Seed) error
Constants ¶
This section is empty.
Variables ¶
var Migrations embed.FS
Functions ¶
Types ¶
type Db ¶
type Db struct { *postgresql.Database Sqlx *sqlx.DB }
Db represents a PostgreSQL database with expanded features. so that it can properly store custom BigDipper-related data.
func (*Db) DeleteFeeGrantAllowance ¶
func (db *Db) DeleteFeeGrantAllowance(allowance types.GrantRemoval) error
DeleteFeeGrantAllowance removes the fee grant allowance data from the database
func (*Db) GetAccounts ¶
GetAccounts returns all the accounts that are currently stored inside the database.
func (*Db) GetBlockHeightTimeDayAgo ¶
GetBlockHeightTimeDayAgo return block height and time that a block proposals about a day (24hour) ago from input date
func (*Db) GetBlockHeightTimeHourAgo ¶
GetBlockHeightTimeHourAgo return block height and time that a block proposals about a hour ago from input date
func (*Db) GetBlockHeightTimeMinuteAgo ¶
GetBlockHeightTimeMinuteAgo return block height and time that a block proposals about a minute ago from input date
func (*Db) GetGenesis ¶
GetGenesis returns the genesis information stored inside the database
func (*Db) GetGovParams ¶
GetGovParams returns the most recent governance parameters
func (*Db) GetLastBlock ¶
GetLastBlock returns the last block stored inside the database based on the heights
func (*Db) GetLastBlockHeight ¶
GetLastBlockHeight returns the last block height stored inside the database
func (*Db) GetOpenProposalsIds ¶
GetOpenProposalsIds returns all the ids of the proposals that are currently in deposit or voting period
func (*Db) GetProposal ¶
GetProposal returns the proposal with the given id, or nil if not found
func (*Db) GetStakingParams ¶
func (db *Db) GetStakingParams() (*types.StakingParams, error)
GetStakingParams returns the types.StakingParams instance containing the current params
func (*Db) GetTokensPriceID ¶
GetTokensPriceID returns the slice of price ids for all tokens stored in db
func (*Db) GetValidator ¶
GetValidator returns the validator having the given address. If no validator for such address can be found, an error is returned instead.
func (*Db) GetValidatorBySelfDelegateAddress ¶
GetValidatorBySelfDelegateAddress returns the validator having the given address as the self_delegate_address, or an error if such validator cannot be found.
func (*Db) GetValidatorConsensusAddress ¶
func (db *Db) GetValidatorConsensusAddress(address string) (sdk.ConsAddress, error)
GetValidatorConsensusAddress returns the consensus address of the validator having the given operator address
func (*Db) GetValidatorOperatorAddress ¶
func (db *Db) GetValidatorOperatorAddress(consAddr string) (sdk.ValAddress, error)
GetValidatorOperatorAddress returns the operator address of the validator having the given consensus address
func (*Db) GetValidators ¶
GetValidators returns all the validators that are currently stored inside the database.
func (*Db) InsertEnableModules ¶
InsertEnableModules allows to save enabled module into the database
func (*Db) RemoveCollection ¶
func (*Db) RemoveCollectionData ¶
func (*Db) RemoveCollectionDataByCollection ¶
func (*Db) RemoveItem ¶
func (*Db) RemoveOnChainItems ¶
func (*Db) RemoveRarimoCoreVotes ¶
func (*Db) RemoveSeed ¶
func (*Db) SaveAccounts ¶
SaveAccounts saves the given accounts inside the database
func (*Db) SaveAverageBlockTimeGenesis ¶
SaveAverageBlockTimeGenesis save the average block time in average_block_time_from_genesis table
func (*Db) SaveAverageBlockTimePerDay ¶
SaveAverageBlockTimePerDay save the average block time in average_block_time_per_day table
func (*Db) SaveAverageBlockTimePerHour ¶
SaveAverageBlockTimePerHour save the average block time in average_block_time_per_hour table
func (*Db) SaveAverageBlockTimePerMin ¶
SaveAverageBlockTimePerMin save the average block time in average_block_time_per_minute table
func (*Db) SaveBridgeParams ¶
func (db *Db) SaveBridgeParams(params *types.BridgeParams) (err error)
SaveBridgeParams saves the given x/bridge parameters inside the database
func (*Db) SaveChangeParties ¶
func (db *Db) SaveChangeParties(changeParties []types.ChangeParties) (err error)
func (*Db) SaveCollectionDatas ¶
func (db *Db) SaveCollectionDatas(collectionDatas []types.CollectionData) error
func (*Db) SaveCollections ¶
func (db *Db) SaveCollections(collections []types.Collection) error
func (*Db) SaveCommunityPool ¶
SaveCommunityPool allows to save for the given height the given total amount of coins
func (*Db) SaveConfirmations ¶
func (db *Db) SaveConfirmations(confirmations []types.Confirmation) (err error)
func (*Db) SaveContractUpgrades ¶
func (db *Db) SaveContractUpgrades(contractUpgrades []types.ContractUpgrade) (err error)
func (*Db) SaveDeposits ¶
SaveDeposits allows to save multiple deposits
func (*Db) SaveDistributionParams ¶
func (db *Db) SaveDistributionParams(params *types.DistributionParams) error
SaveDistributionParams allows to store the given distribution parameters inside the database
func (*Db) SaveDoubleSignEvidence ¶
func (db *Db) SaveDoubleSignEvidence(evidence types.DoubleSignEvidence) error
SaveDoubleSignEvidence saves the given double sign evidence inside the proper tables
func (*Db) SaveFeeGrantAllowance ¶
SaveFeeGrantAllowance allows to store the fee grant allowances for the given block height
func (*Db) SaveFeeTokenManagements ¶
func (db *Db) SaveFeeTokenManagements(managements []types.FeeTokenManagement) (err error)
func (*Db) SaveGenesis ¶
SaveGenesis save the given genesis data
func (*Db) SaveGenesisGovParams ¶
func (db *Db) SaveGenesisGovParams(params *types.GenesisGovParams) error
SaveGenesisGovParams saves the genesis x/gov parameters inside the database
func (*Db) SaveGovParams ¶
SaveGovParams saves the given x/gov parameters inside the database
func (*Db) SaveGroups ¶
SaveGroups saves the given x/multisig groups inside the database
func (*Db) SaveIdentityDefaultTransfers ¶
func (db *Db) SaveIdentityDefaultTransfers(transfers []types.IdentityDefaultTransfer) (err error)
func (*Db) SaveIdentityGISTTransfers ¶ added in v1.0.4
func (db *Db) SaveIdentityGISTTransfers(transfers []types.IdentityGISTTransfer) (err error)
func (*Db) SaveIdentityStateTransfers ¶ added in v1.0.4
func (db *Db) SaveIdentityStateTransfers(transfers []types.IdentityStateTransfer) (err error)
func (*Db) SaveMintParams ¶
func (db *Db) SaveMintParams(params *types.MintParams) error
SaveMintParams allows to store the given params inside the database
func (*Db) SaveMultisigParams ¶
func (db *Db) SaveMultisigParams(params *types.MultisigParams) (err error)
SaveMultisigParams saves the given x/multisig parameters inside the database
func (*Db) SaveMultisigProposalVotes ¶
func (db *Db) SaveMultisigProposalVotes(votes []*types.MultisigProposalVote) (err error)
SaveMultisigProposalVotes saves the given x/multisig proposal votes inside the database
func (*Db) SaveMultisigProposals ¶
func (db *Db) SaveMultisigProposals(proposals []*types.MultisigProposal) (err error)
SaveMultisigProposals saves the given x/multisig proposals inside the database
func (*Db) SaveNetworks ¶ added in v1.0.4
SaveNetworks saves the given x/tokenmanager network parameters inside the database
func (*Db) SaveOnChainItems ¶
func (db *Db) SaveOnChainItems(items []types.OnChainItem) error
func (*Db) SaveOracleManagerParams ¶
func (db *Db) SaveOracleManagerParams(params *types.OracleManagerParams) (err error)
SaveOracleManagerParams saves the given x/oraclemanager parameters inside the database
func (*Db) SaveParties ¶
SaveParties saves the given x/gov parameters inside the database
func (*Db) SaveProposalStakingPoolSnapshot ¶
func (db *Db) SaveProposalStakingPoolSnapshot(snapshot types.ProposalStakingPoolSnapshot) error
SaveProposalStakingPoolSnapshot allows to save the given snapshot of the staking pool
func (*Db) SaveProposalValidatorsStatusesSnapshots ¶
func (db *Db) SaveProposalValidatorsStatusesSnapshots(snapshots []types.ProposalValidatorStatusSnapshot) error
SaveProposalValidatorsStatusesSnapshots allows to save the given validator statuses snapshots
func (*Db) SaveProposals ¶
SaveProposals allows to save for the given height the given total amount of coins
func (*Db) SaveRarimoCoreParams ¶
func (db *Db) SaveRarimoCoreParams(params *types.RarimoCoreParams) (err error)
SaveRarimoCoreParams saves the given x/rarimocore parameters inside the database
func (*Db) SaveRarimoCoreVotes ¶
func (db *Db) SaveRarimoCoreVotes(votes []types.RarimoCoreVote) (err error)
func (*Db) SaveSlashingParams ¶
func (db *Db) SaveSlashingParams(params *types.SlashingParams) error
SaveSlashingParams saves the slashing params for the given height
func (*Db) SaveStakingParams ¶
func (db *Db) SaveStakingParams(params types.StakingParams) error
SaveStakingParams allows to store the given params into the database
func (*Db) SaveStakingPool ¶
SaveStakingPool allows to save for the given height the given stakingtypes pool
func (*Db) SaveSupply ¶
SaveSupply allows to save for the given height the given total amount of coins
func (*Db) SaveTallyResults ¶
func (db *Db) SaveTallyResults(tallys []types.TallyResult) error
SaveTallyResults allows to save for the given height the given total amount of coins
func (*Db) SaveTokenPricesHistory ¶
func (db *Db) SaveTokenPricesHistory(prices []types.TokenPrice) error
SaveTokenPricesHistory stores the given prices as historic ones
func (*Db) SaveTokensPrices ¶
func (db *Db) SaveTokensPrices(prices []types.TokenPrice) error
SaveTokensPrices allows to save the given prices as the most updated ones
func (*Db) SaveValidatorCommission ¶
func (db *Db) SaveValidatorCommission(data types.ValidatorCommission) error
SaveValidatorCommission saves a single validator commission. It assumes that the delegator address is already present inside the proper database table. TIP: To store the validator data call SaveValidatorData.
func (*Db) SaveValidatorData ¶
SaveValidatorData saves properly the information about the given validator.
func (*Db) SaveValidatorDescription ¶
func (db *Db) SaveValidatorDescription(description types.ValidatorDescription) error
SaveValidatorDescription save a single validator description. It assumes that the delegator address is already present inside the proper database table. TIP: To store the validator data call SaveValidatorData.
func (*Db) SaveValidatorsData ¶
SaveValidatorsData allows the bulk saving of a list of validators.
func (*Db) SaveValidatorsSigningInfos ¶
func (db *Db) SaveValidatorsSigningInfos(infos []types.ValidatorSigningInfo) error
SaveValidatorsSigningInfos saves the given infos inside the database
func (*Db) SaveValidatorsStatuses ¶
func (db *Db) SaveValidatorsStatuses(statuses []types.ValidatorStatus) error
SaveValidatorsStatuses save validator jail and status in the given height and timestamp
func (*Db) SaveValidatorsVotingPowers ¶
func (db *Db) SaveValidatorsVotingPowers(entries []types.ValidatorVotingPower) error
SaveValidatorsVotingPowers saves the given validator voting powers. It assumes that the delegator address is already present inside the proper database table. TIP: To store the validator data call SaveValidatorData.
func (*Db) SaveVestingAccounts ¶
func (db *Db) SaveVestingAccounts(vestingAccounts []exported.VestingAccount) error
SaveVestingAccounts saves the given vesting accounts inside the database
func (*Db) SaveViolationReports ¶
func (db *Db) SaveViolationReports(reports []types.ViolationReport) (err error)
func (*Db) StoreBaseVestingAccountFromMsg ¶
func (db *Db) StoreBaseVestingAccountFromMsg(bva *vestingtypes.BaseVestingAccount, txTimestamp time.Time) error
func (*Db) UpdateChangeParties ¶
func (db *Db) UpdateChangeParties(changeParties types.ChangeParties) (err error)
func (*Db) UpdateCollection ¶
func (db *Db) UpdateCollection(collection types.Collection) error
func (*Db) UpdateCollectionData ¶
func (db *Db) UpdateCollectionData(data types.CollectionData) error
func (*Db) UpdateProposal ¶
func (db *Db) UpdateProposal(update types.ProposalUpdate) error
UpdateProposal updates a proposal stored inside the database