-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
accepts QueryParams: * GET /chain/blocks * page * limit * chainId * hash * proposerAddress * api: add structs BlockList, BlockParams * api: add consts ParamChainId, ParamHash, ParamProposerAddress * indexer: add indexertypes.Block
- Loading branch information
Showing
4 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package indexertypes | ||
|
||
import ( | ||
"time" | ||
|
||
"go.vocdoni.io/dvote/types" | ||
) | ||
|
||
// Block represents a block handled by the Vochain. | ||
// The indexer Block data type is different from the vochain state data type | ||
// since it is optimized for querying purposes and not for keeping a shared consensus state. | ||
type Block struct { | ||
ChainID string `json:"chainId"` | ||
Height int64 `json:"height"` | ||
Time time.Time `json:"time"` | ||
Hash types.HexBytes `json:"hash"` | ||
ProposerAddress types.HexBytes `json:"proposer"` | ||
LastBlockHash types.HexBytes `json:"lastBlockHash"` | ||
TxCount int64 `json:"txCount"` | ||
} |