repository

package
v0.0.0-...-2749a05 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	BlockNum   int64  `json:"block_num"`
	BlockHash  string `json:"block_hash"`
	ParentHash string `json:"parent_hash"`
	BlockTime  uint64 `json:"block_time"`
}

type BlockRepo

type BlockRepo interface {
	GetBlockByID(context.Context, int64) (Block, error)
	GetBlockByHash(context.Context, string) (Block, error)
	//GetLatestNBlocks(int) ([]Block, error)
	InsertFullBlockInfo(context.Context, Block, []Tx) error
}

type SummaryRepo

type SummaryRepo interface {
	GetMaxBlockNum(context.Context) int64
}

type Tx

type Tx struct {
	TxHash   string `json:"tx_hash"`
	BlockNum int64
	TxFrom   string `json:"from"`
	TxTo     string `json:"to"`
	TxNonce  uint64 `json:"nonce"`
	TxData   string `json:"data"`
	TxValue  string `json:"value"`
}

type TxRepo

type TxRepo interface {
	GetTXByHash(context.Context, string) (Tx, error)
	GetTXsByBlockNum(context.Context, int64) ([]Tx, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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