indexerdb

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateProcessParams

type CreateProcessParams struct {
	ID                types.ProcessID
	EntityID          types.EntityID
	StartBlock        int64
	EndBlock          int64
	ResultsHeight     int64
	HaveResults       bool
	FinalResults      bool
	CensusRoot        types.CensusRoot
	RollingCensusRoot types.CensusRoot
	RollingCensusSize int64
	MaxCensusSize     int64
	CensusUri         string
	Metadata          string
	CensusOrigin      int64
	Status            int64
	Namespace         int64
	EnvelopePb        types.EncodedProtoBuf
	ModePb            types.EncodedProtoBuf
	VoteOptsPb        types.EncodedProtoBuf
	PrivateKeys       string
	PublicKeys        string
	QuestionIndex     int64
	CreationTime      time.Time
	SourceBlockHeight int64
	SourceNetworkID   int64
	ResultsVotes      string
}

type CreateTokenTransferParams

type CreateTokenTransferParams struct {
	TxHash       types.Hash
	Height       int64
	FromAccount  types.AccountID
	ToAccount    types.AccountID
	Amount       int64
	TransferTime time.Time
}

type CreateTxReferenceParams

type CreateTxReferenceParams struct {
	Hash         types.Hash
	BlockHeight  int64
	TxBlockIndex int64
	TxType       string
}

type CreateVoteReferenceParams

type CreateVoteReferenceParams struct {
	Nullifier      types.Nullifier
	ProcessID      types.ProcessID
	Height         int64
	Weight         string
	TxIndex        int64
	VoterID        state.VoterID
	OverwriteCount int64
	CreationTime   time.Time
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetLastTxReferencesParams

type GetLastTxReferencesParams struct {
	Limit  int32
	Offset int32
}

type GetTokenTransfersByFromAccountParams

type GetTokenTransfersByFromAccountParams struct {
	FromAccount types.AccountID
	Limit       int32
	Offset      int32
}

type Process

type Process struct {
	ID                    types.ProcessID
	EntityID              types.EntityID
	StartBlock            int64
	EndBlock              int64
	ResultsHeight         int64
	HaveResults           bool
	FinalResults          bool
	ResultsVotes          string
	ResultsWeight         string
	ResultsEnvelopeHeight int64
	ResultsSignatures     string
	ResultsBlockHeight    int64
	CensusRoot            types.CensusRoot
	RollingCensusRoot     types.CensusRoot
	RollingCensusSize     int64
	MaxCensusSize         int64
	CensusUri             string
	Metadata              string
	CensusOrigin          int64
	Status                int64
	Namespace             int64
	EnvelopePb            types.EncodedProtoBuf
	ModePb                types.EncodedProtoBuf
	VoteOptsPb            types.EncodedProtoBuf
	PrivateKeys           string
	PublicKeys            string
	QuestionIndex         int64
	CreationTime          time.Time
	SourceBlockHeight     int64
	SourceNetworkID       int64
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CountTxReferences

func (q *Queries) CountTxReferences(ctx context.Context) (int64, error)

func (*Queries) CreateProcess

func (q *Queries) CreateProcess(ctx context.Context, arg CreateProcessParams) (sql.Result, error)

func (*Queries) CreateTokenTransfer

func (q *Queries) CreateTokenTransfer(ctx context.Context, arg CreateTokenTransferParams) (sql.Result, error)

func (*Queries) CreateTxReference

func (q *Queries) CreateTxReference(ctx context.Context, arg CreateTxReferenceParams) (sql.Result, error)

func (*Queries) CreateVoteReference

func (q *Queries) CreateVoteReference(ctx context.Context, arg CreateVoteReferenceParams) (sql.Result, error)

func (*Queries) GetEntityCount

func (q *Queries) GetEntityCount(ctx context.Context) (int64, error)

func (*Queries) GetEntityProcessCount

func (q *Queries) GetEntityProcessCount(ctx context.Context, entityID types.EntityID) (int64, error)

func (*Queries) GetLastTxReferences

func (q *Queries) GetLastTxReferences(ctx context.Context, arg GetLastTxReferencesParams) ([]TxReference, error)

func (*Queries) GetProcess

func (q *Queries) GetProcess(ctx context.Context, id types.ProcessID) (Process, error)

func (*Queries) GetProcessCount

func (q *Queries) GetProcessCount(ctx context.Context) (int64, error)

func (*Queries) GetProcessEnvelopeHeight

func (q *Queries) GetProcessEnvelopeHeight(ctx context.Context, id types.ProcessID) (int64, error)

func (*Queries) GetProcessIDsByFinalResults

func (q *Queries) GetProcessIDsByFinalResults(ctx context.Context, finalResults bool) ([]types.ProcessID, error)

func (*Queries) GetProcessIDsByResultsHeight

func (q *Queries) GetProcessIDsByResultsHeight(ctx context.Context, resultsHeight int64) ([]types.ProcessID, error)

func (*Queries) GetProcessStatus

func (q *Queries) GetProcessStatus(ctx context.Context, id types.ProcessID) (int64, error)

func (*Queries) GetTokenTransfer

func (q *Queries) GetTokenTransfer(ctx context.Context, txHash types.Hash) (TokenTransfer, error)

func (*Queries) GetTokenTransfersByFromAccount

func (q *Queries) GetTokenTransfersByFromAccount(ctx context.Context, arg GetTokenTransfersByFromAccountParams) ([]TokenTransfer, error)

the column and parameter; see sqlc.yaml TODO(jordipainan): use sqlc.arg once limit/offset support it: https://github.com/kyleconroy/sqlc/issues/1025

func (*Queries) GetTotalProcessEnvelopeHeight

func (q *Queries) GetTotalProcessEnvelopeHeight(ctx context.Context) (interface{}, error)

func (*Queries) GetTxReference

func (q *Queries) GetTxReference(ctx context.Context, id int64) (TxReference, error)

func (*Queries) GetTxReferenceByHash

func (q *Queries) GetTxReferenceByHash(ctx context.Context, hash types.Hash) (TxReference, error)

func (*Queries) GetVoteReference

func (q *Queries) GetVoteReference(ctx context.Context, nullifier types.Nullifier) (VoteReference, error)

func (*Queries) GetVoteReferencesByProcessID

func (q *Queries) GetVoteReferencesByProcessID(ctx context.Context, processID types.ProcessID) ([]VoteReference, error)

func (*Queries) SearchEntities

func (q *Queries) SearchEntities(ctx context.Context, arg SearchEntitiesParams) ([]types.EntityID, error)

func (*Queries) SearchProcesses

func (q *Queries) SearchProcesses(ctx context.Context, arg SearchProcessesParams) ([]types.ProcessID, error)

TODO(mvdan): when sqlc's parser is better, and does not get confused with string types, use: WHERE (LENGTH(sqlc.arg(entity_id)) = 0 OR entity_id = sqlc.arg(entity_id)) TODO(mvdan): use sqlc.arg once limit/offset support it: https://github.com/kyleconroy/sqlc/issues/1025 LIMIT sqlc.arg(limit) OFFSET sqlc.arg(offset)

func (*Queries) SearchVoteReferences

func (q *Queries) SearchVoteReferences(ctx context.Context, arg SearchVoteReferencesParams) ([]VoteReference, error)

func (*Queries) SetProcessResultsCancelled

func (q *Queries) SetProcessResultsCancelled(ctx context.Context, id types.ProcessID) (sql.Result, error)

func (*Queries) SetProcessResultsHeight

func (q *Queries) SetProcessResultsHeight(ctx context.Context, arg SetProcessResultsHeightParams) (sql.Result, error)

func (*Queries) SetProcessResultsReady

func (q *Queries) SetProcessResultsReady(ctx context.Context, arg SetProcessResultsReadyParams) (sql.Result, error)

func (*Queries) UpdateProcessFromState

func (q *Queries) UpdateProcessFromState(ctx context.Context, arg UpdateProcessFromStateParams) (sql.Result, error)

func (*Queries) UpdateProcessResultByID

func (q *Queries) UpdateProcessResultByID(ctx context.Context, arg UpdateProcessResultByIDParams) (sql.Result, error)

func (*Queries) UpdateProcessResults

func (q *Queries) UpdateProcessResults(ctx context.Context, arg UpdateProcessResultsParams) (sql.Result, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type SearchEntitiesParams

type SearchEntitiesParams struct {
	EntityIDSubstr string
	Limit          int32
	Offset         int32
}

type SearchProcessesParams

type SearchProcessesParams struct {
	EntityIDLen     interface{}
	EntityID        types.EntityID
	Namespace       int64
	Status          int64
	SourceNetworkID int64
	IDSubstr        string
	WithResults     interface{}
	Limit           int32
	Offset          int32
}

type SearchVoteReferencesParams

type SearchVoteReferencesParams struct {
	ProcessID       types.ProcessID
	NullifierSubstr string
	Limit           int32
	Offset          int32
}

type SetProcessResultsHeightParams

type SetProcessResultsHeightParams struct {
	ResultsHeight int64
	ID            types.ProcessID
}

type SetProcessResultsReadyParams

type SetProcessResultsReadyParams struct {
	Votes          string
	Weight         string
	EnvelopeHeight int64
	Signatures     string
	BlockHeight    int64
	ID             types.ProcessID
}

type TokenTransfer

type TokenTransfer struct {
	TxHash       types.Hash
	Height       int64
	FromAccount  types.AccountID
	ToAccount    types.AccountID
	Amount       int64
	TransferTime time.Time
}

type TxReference

type TxReference struct {
	ID           int64
	Hash         types.Hash
	BlockHeight  int64
	TxBlockIndex int64
	TxType       string
}

type UpdateProcessFromStateParams

type UpdateProcessFromStateParams struct {
	EndBlock          int64
	CensusRoot        types.CensusRoot
	RollingCensusRoot types.CensusRoot
	CensusUri         string
	PrivateKeys       string
	PublicKeys        string
	Metadata          string
	RollingCensusSize int64
	Status            int64
	ID                types.ProcessID
}

type UpdateProcessResultByIDParams

type UpdateProcessResultByIDParams struct {
	Votes             string
	Weight            string
	VoteOptsPb        types.EncodedProtoBuf
	EnvelopePb        types.EncodedProtoBuf
	ResultsSignatures string
	ID                types.ProcessID
}

type UpdateProcessResultsParams

type UpdateProcessResultsParams struct {
	Votes          string
	Weight         string
	EnvelopeHeight int64
	BlockHeight    int64
	ID             types.ProcessID
}

type VoteReference

type VoteReference struct {
	Nullifier      types.Nullifier
	ProcessID      types.ProcessID
	Height         int64
	Weight         string
	TxIndex        int64
	CreationTime   time.Time
	VoterID        state.VoterID
	OverwriteCount int64
}

Jump to

Keyboard shortcuts

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