modelsc

package
v0.0.0-...-4c0c530 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("block not found")

Functions

func Marshal

func Marshal(bl *types.Block) ([]byte, error)

Types

type Block

type Block struct {
	Header         types.Header        `json:"header"`
	Uncles         []types.Header      `json:"uncles"`
	TxsBytes       *[][]byte           `json:"txs,omitempty"`
	Version        uint32              `json:"version"`
	BlockExtraData []byte              `json:"blockExtraData"`
	Txs            []types.Transaction `json:"transactions,omitempty"`
}

func New

func New(bl *types.Block) (*Block, error)

func Unmarshal

func Unmarshal(data []byte) (*Block, error)

type BlockContainer

type BlockContainer struct {
	Block  *types.Block
	Traces []*TransactionTrace
	Logs   []*types.Log
}

type Call

type Call struct {
	Type    string         `json:"type"`
	From    common.Address `json:"from"`
	To      common.Address `json:"to"`
	Value   *hexutil.Big   `json:"value"`
	GasUsed *hexutil.Big   `json:"gasUsed"`
	Revert  bool           `json:"revert"`
	Error   string         `json:"error,omitempty"`
	Calls   []*Call        `json:"calls,omitempty"`
}

type Client

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

func NewClient

func NewClient(url string) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Latest

func (c *Client) Latest(rpcTimeout time.Duration) (*big.Int, error)

func (*Client) ReadBlock

func (c *Client) ReadBlock(blockNumber *big.Int, rpcTimeout time.Duration) (*BlockContainer, error)

type TransactionTrace

type TransactionTrace struct {
	Hash  string `json:"hash"`
	Idx   uint32 `json:"idx"`
	Trace []byte `json:"trace"`
}

Jump to

Keyboard shortcuts

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