Skip to content

Commit

Permalink
Merge branch 'feat/index-blocks' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui committed Sep 4, 2024
2 parents ece7951 + 1a47b20 commit 33df70b
Show file tree
Hide file tree
Showing 27 changed files with 985 additions and 386 deletions.
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

0 comments on commit 33df70b

Please sign in to comment.