db

package
v0.0.0-...-58bdd35 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableTransactions                     = "avm_transactions"
	TableOutputsRedeeming                 = "avm_outputs_redeeming"
	TableOutputs                          = "avm_outputs"
	TableAssets                           = "avm_assets"
	TableAddresses                        = "addresses"
	TableAddressChain                     = "address_chain"
	TableOutputAddresses                  = "avm_output_addresses"
	TableTransactionsEpochs               = "transactions_epoch"
	TableCvmAddresses                     = "cvm_addresses"
	TableCvmBlocks                        = "cvm_blocks"
	TableCvmTransactionsAtomic            = "cvm_transactions_atomic"
	TableCvmTransactionsTxdata            = "cvm_transactions_txdata"
	TableCvmAccounts                      = "cvm_accounts"
	TablePvmBlocks                        = "pvm_blocks"
	TableRewards                          = "rewards"
	TableTransactionsValidator            = "transactions_validator"
	TableTransactionsBlock                = "transactions_block"
	TableAddressBech32                    = "addresses_bech32"
	TableOutputAddressAccumulateOut       = "output_addresses_accumulate_out"
	TableOutputAddressAccumulateIn        = "output_addresses_accumulate_in"
	TableOutputTxsAccumulate              = "output_txs_accumulate"
	TableAccumulateBalancesReceived       = "accumulate_balances_received"
	TableAccumulateBalancesSent           = "accumulate_balances_sent"
	TableAccumulateBalancesTransactions   = "accumulate_balances_transactions"
	TableTransactionsRewardsOwners        = "transactions_rewards_owners"
	TableTransactionsRewardsOwnersAddress = "transactions_rewards_owners_address"
	TableTransactionsRewardsOwnersOutputs = "transactions_rewards_owners_outputs"
	TableTxPool                           = "tx_pool"
	TableKeyValueStore                    = "key_value_store"
	TableNodeIndex                        = "node_index"
	TableCamLastBlockCache                = "cam_last_block_cache"
)

Variables

This section is empty.

Functions

func EventErr

func EventErr(t string, upd bool, err error) error

func PrintDbr

func PrintDbr(d *dbr.SelectStmt) *dbr.SelectStmt

Types

type AccumulateBalancesAmount

type AccumulateBalancesAmount struct {
	ID          string
	ChainID     string
	AssetID     string
	Address     string
	TotalAmount string
	UtxoCount   string
	UpdatedAt   time.Time
}

func (*AccumulateBalancesAmount) ComputeID

func (b *AccumulateBalancesAmount) ComputeID()

type AccumulateBalancesTransactions

type AccumulateBalancesTransactions struct {
	ID               string
	ChainID          string
	AssetID          string
	Address          string
	TransactionCount string
	UpdatedAt        time.Time
}

func (*AccumulateBalancesTransactions) ComputeID

func (b *AccumulateBalancesTransactions) ComputeID()

type AddressBech32

type AddressBech32 struct {
	Address       string
	Bech32Address string
	UpdatedAt     time.Time
}

type AddressChain

type AddressChain struct {
	Address   string
	ChainID   string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Addresses

type Addresses struct {
	Address   string
	PublicKey []byte
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Assets

type Assets struct {
	ID            string
	ChainID       string
	Name          string
	Symbol        string
	Denomination  byte
	Alias         string
	CurrentSupply uint64
	CreatedAt     time.Time
}

type CamLastBlockCache

type CamLastBlockCache struct {
	CurrentBlock string
	ChainID      string
}

type CountLastBlockCache

type CountLastBlockCache struct {
	Cnt uint64
}

type CvmAccount

type CvmAccount struct {
	ID         uint64
	Address    string
	TxCount    uint64
	CreationTx *string
}

type CvmAddresses

type CvmAddresses struct {
	ID            string
	Type          models.CChainType
	Idx           uint64
	TransactionID string
	Address       string
	AssetID       string
	Amount        uint64
	Nonce         uint64
	CreatedAt     time.Time
}

type CvmBlocks

type CvmBlocks struct {
	Block         string
	Hash          string
	ChainID       string
	EvmTx         int16
	AtomicTx      int16
	Serialization []byte
	CreatedAt     time.Time
	Proposer      string
	ProposerTime  *time.Time
}

type CvmLogs

type CvmLogs struct {
	ID            string
	BlockHash     string
	TxHash        string
	LogIndex      uint64
	FirstTopic    string
	Block         string
	Removed       bool
	CreatedAt     time.Time
	Serialization []byte
}

func (*CvmLogs) ComputeID

func (b *CvmLogs) ComputeID()

type CvmTransactionsAtomic

type CvmTransactionsAtomic struct {
	TransactionID string
	Block         string
	ChainID       string
	Type          models.CChainType
	CreatedAt     time.Time
}

type CvmTransactionsTxdata

type CvmTransactionsTxdata struct {
	Hash          string
	Block         string
	Idx           uint64
	FromAddr      string
	ToAddr        string
	Nonce         uint64
	Amount        uint64
	Status        uint16
	GasUsed       uint64
	GasPrice      uint64
	Serialization []byte
	Receipt       []byte
	CreatedAt     time.Time
}

type KeyValueStore

type KeyValueStore struct {
	K string
	V string
}

type MockPersist

type MockPersist struct {
	Transactions                     map[string]*Transactions
	Outputs                          map[string]*Outputs
	OutputsRedeeming                 map[string]*OutputsRedeeming
	CvmTransactionsAtomic            map[string]*CvmTransactionsAtomic
	CvmTransactionsTxdata            map[string]*CvmTransactionsTxdata
	CvmAccounts                      map[string]*CvmAccount
	CvmBlocks                        map[string]*CvmBlocks
	CamLastBlockCache                map[string]*CamLastBlockCache
	CountLastBlockCache              map[string]*CountLastBlockCache
	CvmAddresses                     map[string]*CvmAddresses
	TransactionsValidator            map[string]*TransactionsValidator
	TransactionsBlock                map[string]*TransactionsBlock
	Rewards                          map[string]*Rewards
	Addresses                        map[string]*Addresses
	AddressChain                     map[string]*AddressChain
	OutputAddresses                  map[string]*OutputAddresses
	Assets                           map[string]*Assets
	TransactionsEpoch                map[string]*TransactionsEpoch
	PvmBlocks                        map[string]*PvmBlocks
	AddressBech32                    map[string]*AddressBech32
	OutputAddressAccumulateOut       map[string]*OutputAddressAccumulate
	OutputAddressAccumulateIn        map[string]*OutputAddressAccumulate
	OutputTxsAccumulate              map[string]*OutputTxsAccumulate
	AccumulateBalancesReceived       map[string]*AccumulateBalancesAmount
	AccumulateBalancesSent           map[string]*AccumulateBalancesAmount
	AccumulateBalancesTransactions   map[string]*AccumulateBalancesTransactions
	TransactionsRewardsOwnersAddress map[string]*TransactionsRewardsOwnersAddress
	TransactionsRewardsOwnersOutputs map[string]*TransactionsRewardsOwnersOutputs
	TransactionsRewardsOwners        map[string]*TransactionsRewardsOwners
	TxPool                           map[string]*TxPool
	KeyValueStore                    map[string]*KeyValueStore
	NodeIndex                        map[string]*NodeIndex
	// contains filtered or unexported fields
}

func NewPersistMock

func NewPersistMock() *MockPersist

func (*MockPersist) InsertAccumulateBalancesReceived

func (m *MockPersist) InsertAccumulateBalancesReceived(ctx context.Context, runner dbr.SessionRunner, v *AccumulateBalancesAmount) error

func (*MockPersist) InsertAccumulateBalancesSent

func (m *MockPersist) InsertAccumulateBalancesSent(ctx context.Context, runner dbr.SessionRunner, v *AccumulateBalancesAmount) error

func (*MockPersist) InsertAccumulateBalancesTransactions

func (m *MockPersist) InsertAccumulateBalancesTransactions(ctx context.Context, runner dbr.SessionRunner, v *AccumulateBalancesTransactions) error

func (*MockPersist) InsertAddressBech32

func (m *MockPersist) InsertAddressBech32(ctx context.Context, runner dbr.SessionRunner, v *AddressBech32, b bool) error

func (*MockPersist) InsertAddressChain

func (m *MockPersist) InsertAddressChain(ctx context.Context, runner dbr.SessionRunner, v *AddressChain, b bool) error

func (*MockPersist) InsertAddresses

func (m *MockPersist) InsertAddresses(ctx context.Context, runner dbr.SessionRunner, v *Addresses, b bool) error

func (*MockPersist) InsertAssets

func (m *MockPersist) InsertAssets(ctx context.Context, runner dbr.SessionRunner, v *Assets, b bool) error

func (*MockPersist) InsertCamLastBlockCache

func (m *MockPersist) InsertCamLastBlockCache(ctx context.Context, runner dbr.SessionRunner, v *CamLastBlockCache, flag bool) error

func (*MockPersist) InsertCvmAccount

func (m *MockPersist) InsertCvmAccount(ctx context.Context, runner dbr.SessionRunner, v *CvmAccount, b bool) error

func (*MockPersist) InsertCvmAddresses

func (m *MockPersist) InsertCvmAddresses(ctx context.Context, runner dbr.SessionRunner, v *CvmAddresses, b bool) error

func (*MockPersist) InsertCvmBlocks

func (m *MockPersist) InsertCvmBlocks(ctx context.Context, runner dbr.SessionRunner, v *CvmBlocks) error

func (*MockPersist) InsertCvmTransactionsAtomic

func (m *MockPersist) InsertCvmTransactionsAtomic(ctx context.Context, runner dbr.SessionRunner, v *CvmTransactionsAtomic, b bool) error

func (*MockPersist) InsertCvmTransactionsTxdata

func (m *MockPersist) InsertCvmTransactionsTxdata(ctx context.Context, runner dbr.SessionRunner, v *CvmTransactionsTxdata, b bool) error

func (*MockPersist) InsertKeyValueStore

func (m *MockPersist) InsertKeyValueStore(ctx context.Context, runner dbr.SessionRunner, v *KeyValueStore) error

func (*MockPersist) InsertNodeIndex

func (m *MockPersist) InsertNodeIndex(ctx context.Context, runner dbr.SessionRunner, v *NodeIndex, _ bool) error

func (*MockPersist) InsertOutputAddressAccumulateIn

func (m *MockPersist) InsertOutputAddressAccumulateIn(ctx context.Context, runner dbr.SessionRunner, v *OutputAddressAccumulate, _ bool) error

func (*MockPersist) InsertOutputAddressAccumulateOut

func (m *MockPersist) InsertOutputAddressAccumulateOut(ctx context.Context, runner dbr.SessionRunner, v *OutputAddressAccumulate, _ bool) error

func (*MockPersist) InsertOutputAddresses

func (m *MockPersist) InsertOutputAddresses(ctx context.Context, runner dbr.SessionRunner, v *OutputAddresses, b bool) error

func (*MockPersist) InsertOutputTxsAccumulate

func (m *MockPersist) InsertOutputTxsAccumulate(ctx context.Context, runner dbr.SessionRunner, v *OutputTxsAccumulate) error

func (*MockPersist) InsertOutputs

func (m *MockPersist) InsertOutputs(ctx context.Context, runner dbr.SessionRunner, v *Outputs, b bool) error

func (*MockPersist) InsertOutputsRedeeming

func (m *MockPersist) InsertOutputsRedeeming(ctx context.Context, runner dbr.SessionRunner, v *OutputsRedeeming, b bool) error

func (*MockPersist) InsertPvmBlocks

func (m *MockPersist) InsertPvmBlocks(ctx context.Context, runner dbr.SessionRunner, v *PvmBlocks, b bool) error

func (*MockPersist) InsertRewards

func (m *MockPersist) InsertRewards(ctx context.Context, runner dbr.SessionRunner, v *Rewards, b bool) error

func (*MockPersist) InsertTransactions

func (m *MockPersist) InsertTransactions(ctx context.Context, runner dbr.SessionRunner, v *Transactions, b bool) error

func (*MockPersist) InsertTransactionsBlock

func (m *MockPersist) InsertTransactionsBlock(ctx context.Context, runner dbr.SessionRunner, v *TransactionsBlock, b bool) error

func (*MockPersist) InsertTransactionsEpoch

func (m *MockPersist) InsertTransactionsEpoch(ctx context.Context, runner dbr.SessionRunner, v *TransactionsEpoch, b bool) error

func (*MockPersist) InsertTransactionsRewardsOwners

func (m *MockPersist) InsertTransactionsRewardsOwners(ctx context.Context, runner dbr.SessionRunner, v *TransactionsRewardsOwners, b bool) error

func (*MockPersist) InsertTransactionsRewardsOwnersAddress

func (m *MockPersist) InsertTransactionsRewardsOwnersAddress(ctx context.Context, runner dbr.SessionRunner, v *TransactionsRewardsOwnersAddress, b bool) error

func (*MockPersist) InsertTransactionsRewardsOwnersOutputs

func (m *MockPersist) InsertTransactionsRewardsOwnersOutputs(ctx context.Context, runner dbr.SessionRunner, v *TransactionsRewardsOwnersOutputs, b bool) error

func (*MockPersist) InsertTransactionsValidator

func (m *MockPersist) InsertTransactionsValidator(ctx context.Context, runner dbr.SessionRunner, v *TransactionsValidator, b bool) error

func (*MockPersist) InsertTxPool

func (m *MockPersist) InsertTxPool(ctx context.Context, runner dbr.SessionRunner, v *TxPool) error

func (*MockPersist) QueryAccumulateBalancesReceived

func (m *MockPersist) QueryAccumulateBalancesReceived(ctx context.Context, runner dbr.SessionRunner, v *AccumulateBalancesAmount) (*AccumulateBalancesAmount, error)

func (*MockPersist) QueryAccumulateBalancesSent

func (m *MockPersist) QueryAccumulateBalancesSent(ctx context.Context, runner dbr.SessionRunner, v *AccumulateBalancesAmount) (*AccumulateBalancesAmount, error)

func (*MockPersist) QueryAccumulateBalancesTransactions

func (m *MockPersist) QueryAccumulateBalancesTransactions(ctx context.Context, runner dbr.SessionRunner, v *AccumulateBalancesTransactions) (*AccumulateBalancesTransactions, error)

func (*MockPersist) QueryAddressBech32

func (m *MockPersist) QueryAddressBech32(ctx context.Context, runner dbr.SessionRunner, v *AddressBech32) (*AddressBech32, error)

func (*MockPersist) QueryAddressChain

func (m *MockPersist) QueryAddressChain(ctx context.Context, runner dbr.SessionRunner, v *AddressChain) (*AddressChain, error)

func (*MockPersist) QueryAddresses

func (m *MockPersist) QueryAddresses(ctx context.Context, runner dbr.SessionRunner, v *Addresses) (*Addresses, error)

func (*MockPersist) QueryAssets

func (m *MockPersist) QueryAssets(ctx context.Context, runner dbr.SessionRunner, v *Assets) (*Assets, error)

func (*MockPersist) QueryCamLastBlockCache

func (m *MockPersist) QueryCamLastBlockCache(ctx context.Context, runner dbr.SessionRunner, v *CamLastBlockCache) (*CamLastBlockCache, error)

func (*MockPersist) QueryCountLastBlockCache

func (m *MockPersist) QueryCountLastBlockCache(ctx context.Context, runner dbr.SessionRunner, v *CamLastBlockCache) (*CountLastBlockCache, error)

this mock needs to be enriched

func (*MockPersist) QueryCvmAccount

func (m *MockPersist) QueryCvmAccount(ctx context.Context, runner dbr.SessionRunner, v *CvmAccount) (*CvmAccount, error)

func (*MockPersist) QueryCvmAddresses

func (m *MockPersist) QueryCvmAddresses(ctx context.Context, runner dbr.SessionRunner, v *CvmAddresses) (*CvmAddresses, error)

func (*MockPersist) QueryCvmBlock

func (m *MockPersist) QueryCvmBlock(ctx context.Context, runner dbr.SessionRunner, v *CvmBlocks) (*CvmBlocks, error)

func (*MockPersist) QueryCvmTransactionsAtomic

func (m *MockPersist) QueryCvmTransactionsAtomic(ctx context.Context, runner dbr.SessionRunner, v *CvmTransactionsAtomic) (*CvmTransactionsAtomic, error)

func (*MockPersist) QueryCvmTransactionsTxdata

func (m *MockPersist) QueryCvmTransactionsTxdata(ctx context.Context, runner dbr.SessionRunner, v *CvmTransactionsTxdata) (*CvmTransactionsTxdata, error)

func (*MockPersist) QueryKeyValueStore

func (m *MockPersist) QueryKeyValueStore(ctx context.Context, runner dbr.SessionRunner, v *KeyValueStore) (*KeyValueStore, error)

func (*MockPersist) QueryNodeIndex

func (m *MockPersist) QueryNodeIndex(ctx context.Context, runner dbr.SessionRunner, v *NodeIndex) (*NodeIndex, error)

func (*MockPersist) QueryOutputAddressAccumulateIn

func (m *MockPersist) QueryOutputAddressAccumulateIn(ctx context.Context, runner dbr.SessionRunner, v *OutputAddressAccumulate) (*OutputAddressAccumulate, error)

func (*MockPersist) QueryOutputAddressAccumulateOut

func (m *MockPersist) QueryOutputAddressAccumulateOut(ctx context.Context, runner dbr.SessionRunner, v *OutputAddressAccumulate) (*OutputAddressAccumulate, error)

func (*MockPersist) QueryOutputAddresses

func (m *MockPersist) QueryOutputAddresses(ctx context.Context, runner dbr.SessionRunner, v *OutputAddresses) (*OutputAddresses, error)

func (*MockPersist) QueryOutputTxsAccumulate

func (m *MockPersist) QueryOutputTxsAccumulate(ctx context.Context, runner dbr.SessionRunner, v *OutputTxsAccumulate) (*OutputTxsAccumulate, error)

func (*MockPersist) QueryOutputs

func (m *MockPersist) QueryOutputs(ctx context.Context, runner dbr.SessionRunner, v *Outputs) (*Outputs, error)

func (*MockPersist) QueryOutputsRedeeming

func (m *MockPersist) QueryOutputsRedeeming(ctx context.Context, runner dbr.SessionRunner, v *OutputsRedeeming) (*OutputsRedeeming, error)

func (*MockPersist) QueryPvmBlocks

func (m *MockPersist) QueryPvmBlocks(ctx context.Context, runner dbr.SessionRunner, v *PvmBlocks) (*PvmBlocks, error)

func (*MockPersist) QueryRewards

func (m *MockPersist) QueryRewards(ctx context.Context, runner dbr.SessionRunner, v *Rewards) (*Rewards, error)

func (*MockPersist) QueryTransactions

func (m *MockPersist) QueryTransactions(ctx context.Context, runner dbr.SessionRunner, v *Transactions) (*Transactions, error)

func (*MockPersist) QueryTransactionsBlock

func (m *MockPersist) QueryTransactionsBlock(ctx context.Context, runner dbr.SessionRunner, v *TransactionsBlock) (*TransactionsBlock, error)

func (*MockPersist) QueryTransactionsEpoch

func (m *MockPersist) QueryTransactionsEpoch(ctx context.Context, runner dbr.SessionRunner, v *TransactionsEpoch) (*TransactionsEpoch, error)

func (*MockPersist) QueryTransactionsRewardsOwners

func (m *MockPersist) QueryTransactionsRewardsOwners(ctx context.Context, runner dbr.SessionRunner, v *TransactionsRewardsOwners) (*TransactionsRewardsOwners, error)

func (*MockPersist) QueryTransactionsRewardsOwnersAddress

func (m *MockPersist) QueryTransactionsRewardsOwnersAddress(ctx context.Context, runner dbr.SessionRunner, v *TransactionsRewardsOwnersAddress) (*TransactionsRewardsOwnersAddress, error)

func (*MockPersist) QueryTransactionsRewardsOwnersOutputs

func (m *MockPersist) QueryTransactionsRewardsOwnersOutputs(ctx context.Context, runner dbr.SessionRunner, v *TransactionsRewardsOwnersOutputs) (*TransactionsRewardsOwnersOutputs, error)

func (*MockPersist) QueryTransactionsValidator

func (m *MockPersist) QueryTransactionsValidator(ctx context.Context, runner dbr.SessionRunner, v *TransactionsValidator) (*TransactionsValidator, error)

func (*MockPersist) QueryTxPool

func (m *MockPersist) QueryTxPool(ctx context.Context, runner dbr.SessionRunner, v *TxPool) (*TxPool, error)

func (*MockPersist) RemoveTxPool

func (m *MockPersist) RemoveTxPool(ctx context.Context, runner dbr.SessionRunner, v *TxPool) error

func (*MockPersist) UpdateNodeIndex

func (m *MockPersist) UpdateNodeIndex(ctx context.Context, runner dbr.SessionRunner, v *NodeIndex) error

func (*MockPersist) UpdateOutputAddressAccumulateInOutputsProcessed

func (m *MockPersist) UpdateOutputAddressAccumulateInOutputsProcessed(ctx context.Context, runner dbr.SessionRunner, id string) error

func (*MockPersist) UpdateOutputAddresses

func (m *MockPersist) UpdateOutputAddresses(ctx context.Context, runner dbr.SessionRunner, v *OutputAddresses) error

func (*MockPersist) UpdateRewardsProcessed

func (m *MockPersist) UpdateRewardsProcessed(ctx context.Context, sess dbr.SessionRunner, v *Rewards) error

type NodeIndex

type NodeIndex struct {
	Instance string
	Topic    string
	Idx      uint64
}

type OutputAddressAccumulate

type OutputAddressAccumulate struct {
	ID              string
	OutputID        string
	Address         string
	Processed       int
	OutputProcessed int
	TransactionID   string
	OutputIndex     uint32
	CreatedAt       time.Time
}

func (*OutputAddressAccumulate) ComputeID

func (b *OutputAddressAccumulate) ComputeID()

type OutputAddresses

type OutputAddresses struct {
	OutputID           string
	Address            string
	RedeemingSignature []byte
	CreatedAt          time.Time
	UpdatedAt          time.Time
}

type OutputTxsAccumulate

type OutputTxsAccumulate struct {
	ID            string
	ChainID       string
	AssetID       string
	Address       string
	TransactionID string
	Processed     int
	CreatedAt     time.Time
}

func (*OutputTxsAccumulate) ComputeID

func (b *OutputTxsAccumulate) ComputeID()

type Outputs

type Outputs struct {
	ID            string
	ChainID       string
	TransactionID string
	OutputIndex   uint32
	OutputType    models.OutputType
	AssetID       string
	Amount        uint64
	Locktime      uint64
	Threshold     uint32
	GroupID       uint32
	Payload       []byte
	StakeLocktime uint64
	Stake         bool
	Frozen        bool
	Stakeableout  bool
	Genesisutxo   bool
	CreatedAt     time.Time
}

type OutputsRedeeming

type OutputsRedeeming struct {
	ID                     string
	RedeemedAt             time.Time
	RedeemingTransactionID string
	Amount                 uint64
	OutputIndex            uint32
	Intx                   string
	AssetID                string
	ChainID                string
	CreatedAt              time.Time
}

type Persist

type Persist interface {
	QueryTransactions(
		context.Context,
		dbr.SessionRunner,
		*Transactions,
	) (*Transactions, error)
	InsertTransactions(
		context.Context,
		dbr.SessionRunner,
		*Transactions,
		bool,
	) error

	QueryOutputsRedeeming(
		context.Context,
		dbr.SessionRunner,
		*OutputsRedeeming,
	) (*OutputsRedeeming, error)
	InsertOutputsRedeeming(
		context.Context,
		dbr.SessionRunner,
		*OutputsRedeeming,
		bool,
	) error

	QueryOutputs(
		context.Context,
		dbr.SessionRunner,
		*Outputs,
	) (*Outputs, error)
	InsertOutputs(
		context.Context,
		dbr.SessionRunner,
		*Outputs,
		bool,
	) error

	QueryAssets(
		context.Context,
		dbr.SessionRunner,
		*Assets,
	) (*Assets, error)
	InsertAssets(
		context.Context,
		dbr.SessionRunner,
		*Assets,
		bool,
	) error

	QueryAddresses(
		context.Context,
		dbr.SessionRunner,
		*Addresses,
	) (*Addresses, error)
	InsertAddresses(
		context.Context,
		dbr.SessionRunner,
		*Addresses,
		bool,
	) error

	QueryAddressChain(
		context.Context,
		dbr.SessionRunner,
		*AddressChain,
	) (*AddressChain, error)

	InsertAddressChain(
		context.Context,
		dbr.SessionRunner,
		*AddressChain,
		bool,
	) error

	QueryOutputAddresses(
		context.Context,
		dbr.SessionRunner,
		*OutputAddresses,
	) (*OutputAddresses, error)
	InsertOutputAddresses(
		context.Context,
		dbr.SessionRunner,
		*OutputAddresses,
		bool,
	) error
	UpdateOutputAddresses(
		context.Context,
		dbr.SessionRunner,
		*OutputAddresses,
	) error

	QueryTransactionsEpoch(
		context.Context,
		dbr.SessionRunner,
		*TransactionsEpoch,
	) (*TransactionsEpoch, error)
	InsertTransactionsEpoch(
		context.Context,
		dbr.SessionRunner,
		*TransactionsEpoch,
		bool,
	) error

	QueryCvmBlock(
		context.Context,
		dbr.SessionRunner,
		*CvmBlocks,
	) (*CvmBlocks, error)
	InsertCvmBlocks(
		context.Context,
		dbr.SessionRunner,
		*CvmBlocks,
	) error

	QueryCountLastBlockCache(
		context.Context,
		dbr.SessionRunner,
		*CamLastBlockCache,
	) (*CountLastBlockCache, error)
	QueryCamLastBlockCache(
		context.Context,
		dbr.SessionRunner,
		*CamLastBlockCache,
	) (*CamLastBlockCache, error)
	InsertCamLastBlockCache(
		context.Context,
		dbr.SessionRunner,
		*CamLastBlockCache,
		bool,
	) error

	QueryCvmAddresses(
		context.Context,
		dbr.SessionRunner,
		*CvmAddresses,
	) (*CvmAddresses, error)
	InsertCvmAddresses(
		context.Context,
		dbr.SessionRunner,
		*CvmAddresses,
		bool,
	) error

	QueryCvmTransactionsAtomic(
		context.Context,
		dbr.SessionRunner,
		*CvmTransactionsAtomic,
	) (*CvmTransactionsAtomic, error)
	InsertCvmTransactionsAtomic(
		context.Context,
		dbr.SessionRunner,
		*CvmTransactionsAtomic,
		bool,
	) error

	QueryCvmTransactionsTxdata(
		context.Context,
		dbr.SessionRunner,
		*CvmTransactionsTxdata,
	) (*CvmTransactionsTxdata, error)
	InsertCvmTransactionsTxdata(
		context.Context,
		dbr.SessionRunner,
		*CvmTransactionsTxdata,
		bool,
	) error

	QueryCvmAccount(
		ctx context.Context,
		sess dbr.SessionRunner,
		q *CvmAccount,
	) (*CvmAccount, error)

	InsertCvmAccount(
		ctx context.Context,
		sess dbr.SessionRunner,
		v *CvmAccount,
		upd bool,
	) error

	QueryPvmBlocks(
		context.Context,
		dbr.SessionRunner,
		*PvmBlocks,
	) (*PvmBlocks, error)
	InsertPvmBlocks(
		context.Context,
		dbr.SessionRunner,
		*PvmBlocks,
		bool,
	) error

	QueryRewards(
		context.Context,
		dbr.SessionRunner,
		*Rewards,
	) (*Rewards, error)
	InsertRewards(
		context.Context,
		dbr.SessionRunner,
		*Rewards,
		bool,
	) error
	UpdateRewardsProcessed(
		context.Context,
		dbr.SessionRunner,
		*Rewards,
	) error

	QueryTransactionsValidator(
		context.Context,
		dbr.SessionRunner,
		*TransactionsValidator,
	) (*TransactionsValidator, error)
	InsertTransactionsValidator(
		context.Context,
		dbr.SessionRunner,
		*TransactionsValidator,
		bool,
	) error

	QueryTransactionsBlock(
		context.Context,
		dbr.SessionRunner,
		*TransactionsBlock,
	) (*TransactionsBlock, error)

	InsertTransactionsBlock(
		context.Context,
		dbr.SessionRunner,
		*TransactionsBlock,
		bool,
	) error

	QueryAddressBech32(
		context.Context,
		dbr.SessionRunner,
		*AddressBech32,
	) (*AddressBech32, error)
	InsertAddressBech32(
		context.Context,
		dbr.SessionRunner,
		*AddressBech32,
		bool,
	) error

	QueryOutputAddressAccumulateOut(
		context.Context,
		dbr.SessionRunner,
		*OutputAddressAccumulate,
	) (*OutputAddressAccumulate, error)
	InsertOutputAddressAccumulateOut(
		context.Context,
		dbr.SessionRunner,
		*OutputAddressAccumulate,
		bool,
	) error

	QueryOutputAddressAccumulateIn(
		context.Context,
		dbr.SessionRunner,
		*OutputAddressAccumulate,
	) (*OutputAddressAccumulate, error)
	InsertOutputAddressAccumulateIn(
		context.Context,
		dbr.SessionRunner,
		*OutputAddressAccumulate,
		bool,
	) error
	UpdateOutputAddressAccumulateInOutputsProcessed(
		context.Context,
		dbr.SessionRunner,
		string,
	) error

	QueryOutputTxsAccumulate(
		context.Context,
		dbr.SessionRunner,
		*OutputTxsAccumulate,
	) (*OutputTxsAccumulate, error)
	InsertOutputTxsAccumulate(
		context.Context,
		dbr.SessionRunner,
		*OutputTxsAccumulate,
	) error

	QueryAccumulateBalancesReceived(
		context.Context,
		dbr.SessionRunner,
		*AccumulateBalancesAmount,
	) (*AccumulateBalancesAmount, error)
	InsertAccumulateBalancesReceived(
		context.Context,
		dbr.SessionRunner,
		*AccumulateBalancesAmount,
	) error

	QueryAccumulateBalancesSent(
		context.Context,
		dbr.SessionRunner,
		*AccumulateBalancesAmount,
	) (*AccumulateBalancesAmount, error)
	InsertAccumulateBalancesSent(
		context.Context,
		dbr.SessionRunner,
		*AccumulateBalancesAmount,
	) error

	QueryAccumulateBalancesTransactions(
		context.Context,
		dbr.SessionRunner,
		*AccumulateBalancesTransactions,
	) (*AccumulateBalancesTransactions, error)
	InsertAccumulateBalancesTransactions(
		context.Context,
		dbr.SessionRunner,
		*AccumulateBalancesTransactions,
	) error

	QueryTransactionsRewardsOwnersAddress(
		context.Context,
		dbr.SessionRunner,
		*TransactionsRewardsOwnersAddress,
	) (*TransactionsRewardsOwnersAddress, error)
	InsertTransactionsRewardsOwnersAddress(
		context.Context,
		dbr.SessionRunner,
		*TransactionsRewardsOwnersAddress,
		bool,
	) error

	QueryTransactionsRewardsOwnersOutputs(
		context.Context,
		dbr.SessionRunner,
		*TransactionsRewardsOwnersOutputs,
	) (*TransactionsRewardsOwnersOutputs, error)
	InsertTransactionsRewardsOwnersOutputs(
		context.Context,
		dbr.SessionRunner,
		*TransactionsRewardsOwnersOutputs,
		bool,
	) error

	QueryTransactionsRewardsOwners(
		context.Context,
		dbr.SessionRunner,
		*TransactionsRewardsOwners,
	) (*TransactionsRewardsOwners, error)
	InsertTransactionsRewardsOwners(
		context.Context,
		dbr.SessionRunner,
		*TransactionsRewardsOwners,
		bool,
	) error

	QueryTxPool(
		context.Context,
		dbr.SessionRunner,
		*TxPool,
	) (*TxPool, error)
	InsertTxPool(
		context.Context,
		dbr.SessionRunner,
		*TxPool,
	) error
	RemoveTxPool(
		context.Context,
		dbr.SessionRunner,
		*TxPool,
	) error

	QueryKeyValueStore(
		context.Context,
		dbr.SessionRunner,
		*KeyValueStore,
	) (*KeyValueStore, error)
	InsertKeyValueStore(
		context.Context,
		dbr.SessionRunner,
		*KeyValueStore,
	) error

	QueryNodeIndex(
		context.Context,
		dbr.SessionRunner,
		*NodeIndex,
	) (*NodeIndex, error)
	InsertNodeIndex(
		context.Context,
		dbr.SessionRunner,
		*NodeIndex,
		bool,
	) error
	UpdateNodeIndex(
		context.Context,
		dbr.SessionRunner,
		*NodeIndex,
	) error
}

func NewPersist

func NewPersist() Persist

type PvmBlocks

type PvmBlocks struct {
	ID            string
	ChainID       string
	Type          models.BlockType
	ParentID      string
	Serialization []byte
	CreatedAt     time.Time
	Height        uint64
	Proposer      string
	ProposerTime  *time.Time
}

type Rewards

type Rewards struct {
	ID                 string
	BlockID            string
	Txid               string
	Shouldprefercommit bool
	CreatedAt          time.Time
	Processed          int
}

type Transactions

type Transactions struct {
	ID                     string
	ChainID                string
	Type                   string
	Memo                   []byte
	CanonicalSerialization []byte
	Txfee                  uint64
	NetworkID              uint32
	Genesis                bool
	Status                 uint8
	CreatedAt              time.Time
}

type TransactionsBlock

type TransactionsBlock struct {
	ID        string
	TxBlockID string
	CreatedAt time.Time
}

type TransactionsEpoch

type TransactionsEpoch struct {
	ID        string
	Epoch     uint32
	VertexID  string
	CreatedAt time.Time
}

type TransactionsRewardsOwners

type TransactionsRewardsOwners struct {
	ID        string
	ChainID   string
	Threshold uint32
	Locktime  uint64
	CreatedAt time.Time
}

type TransactionsRewardsOwnersAddress

type TransactionsRewardsOwnersAddress struct {
	ID          string
	Address     string
	OutputIndex uint32
	UpdatedAt   time.Time
}

type TransactionsRewardsOwnersOutputs

type TransactionsRewardsOwnersOutputs struct {
	ID            string
	TransactionID string
	OutputIndex   uint32
	CreatedAt     time.Time
}

type TransactionsValidator

type TransactionsValidator struct {
	ID        string
	NodeID    string
	Start     uint64
	End       uint64
	CreatedAt time.Time
}

type TxPool

type TxPool struct {
	ID            string
	NetworkID     uint32
	ChainID       string
	MsgKey        string
	Serialization []byte
	Topic         string
	CreatedAt     time.Time
}

func (*TxPool) ComputeID

func (b *TxPool) ComputeID()

Jump to

Keyboard shortcuts

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