block

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(routes *wrapper.RouterWrapper)

Routes defines block related routes

Types

type APIBlock

type APIBlock struct {
	Nonce                uint64          `form:"nonce" json:"nonce"`
	Round                uint64          `form:"round" json:"round"`
	Hash                 string          `form:"hash" json:"hash"`
	Epoch                uint32          `form:"epoch" json:"epoch"`
	ShardID              uint32          `form:"shardID" json:"shardID"`
	NumTxs               uint32          `form:"numTxs" json:"numTxs"`
	NotarizedBlockHashes []string        `form:"notarizedBlockHashes" json:"notarizedBlockHashes,omitempty"`
	MiniBlocks           []*APIMiniBlock `form:"miniBlocks" json:"miniBlocks,omitempty"`
}

APIBlock represents the structure for block that is returned by api routes

type APIMiniBlock

type APIMiniBlock struct {
	Hash               string                              `form:"hash" json:"hash"`
	Type               string                              `form:"type" json:"type"`
	SourceShardID      uint32                              `form:"sourceShardID" json:"sourceShardID"`
	DestinationShardID uint32                              `form:"destinationShardID" json:"destinationShardID"`
	Transactions       []*transaction.ApiTransactionResult `form:"transactions" json:"transactions,omitempty"`
}

APIMiniBlock represents the structure for a miniblock

type BlockService

type BlockService interface {
	GetBlockByHash(hash string, withTxs bool) (*APIBlock, error)
	GetBlockByNonce(nonce uint64, withTxs bool) (*APIBlock, error)
}

BlockService interface defines methods that can be used from `dharitriFacade` context variable

Jump to

Keyboard shortcuts

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