Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indexer: index more details about blocks and transactions #1329

Merged
merged 5 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ const (
ParamHeight = "height"
ParamReference = "reference"
ParamType = "type"
ParamSubtype = "subtype"
ParamSigner = "signer"
ParamAccountIdFrom = "accountIdFrom"
ParamAccountIdTo = "accountIdTo"
ParamStartDateAfter = "startDateAfter"
Expand Down
22 changes: 13 additions & 9 deletions api/api_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ type AccountParams struct {
// TransactionParams allows the client to filter transactions
type TransactionParams struct {
PaginationParams
Height uint64 `json:"height,omitempty"`
Type string `json:"type,omitempty"`
Hash string `json:"hash,omitempty"`
Height uint64 `json:"height,omitempty"`
Type string `json:"type,omitempty"`
Subtype string `json:"subtype,omitempty"`
Signer string `json:"signer,omitempty"`
}

// BlockParams allows the client to filter blocks
Expand Down Expand Up @@ -275,8 +278,8 @@ type TransactionReference struct {

// TransactionsList is used to return a paginated list to the client
type TransactionsList struct {
Transactions []*indexertypes.Transaction `json:"transactions"`
Pagination *Pagination `json:"pagination"`
Transactions []*indexertypes.TransactionMetadata `json:"transactions"`
Pagination *Pagination `json:"pagination"`
}

// FeesList is used to return a paginated list to the client
Expand All @@ -292,9 +295,9 @@ type TransfersList struct {
}

type GenericTransactionWithInfo struct {
TxContent json.RawMessage `json:"tx"`
TxInfo indexertypes.Transaction `json:"txInfo"`
Signature types.HexBytes `json:"signature"`
TxContent json.RawMessage `json:"tx"`
TxInfo *indexertypes.Transaction `json:"txInfo"`
Signature types.HexBytes `json:"signature"`
}

type ChainInfo struct {
Expand Down Expand Up @@ -444,8 +447,9 @@ func CensusTypeToOrigin(ctype CensusTypeDescription) (models.CensusOrigin, []byt
}

type Block struct {
comettypes.Block `json:",inline"`
Hash types.HexBytes `json:"hash" `
comettypes.Header `json:"header"`
Hash types.HexBytes `json:"hash" `
TxCount int64 `json:"txCount"`
}

// BlockList is used to return a paginated list to the client
Expand Down
Loading
Loading