types

package
v0.0.0-...-6802d5b Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 3 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 {
	Number       *big.Int       `json:"number"`
	Hash         string         `json:"hash"`
	ParentHash   string         `json:"parentHash"`
	Transactions []*Transaction `json:"transactions"`
}

func (*Block) UnmarshalJSON

func (b *Block) UnmarshalJSON(data []byte) error

Custom unmarshalling for Block to handle hex string to *big.Int for Number

type BlockResponse

type BlockResponse struct {
	JSONRPC string                 `json:"jsonrpc"`
	ID      int                    `json:"id"`
	Result  *Block                 `json:"result"`
	Error   map[string]interface{} `json:"error"`
}

type Chain

type Chain struct {
	// contains filtered or unexported fields
}

func NewChain

func NewChain() *Chain

func (*Chain) Append

func (c *Chain) Append(block *Block)

func (*Chain) PeekHead

func (c *Chain) PeekHead() *Block

func (*Chain) PeekTail

func (c *Chain) PeekTail() *Block

func (*Chain) PopHead

func (c *Chain) PopHead() *Block

func (*Chain) PopTail

func (c *Chain) PopTail() *Block

type Transaction

type Transaction struct {
	From            string `json:"from"`
	To              string `json:"to"`
	TransactionHash string `json:"hash"`
}

Jump to

Keyboard shortcuts

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