ielejson

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogToString

func LogToString(logEntry *LogEntry) string

LogToString returns a json representation of a log entry, we use it for debugging

func ToJSONString

func ToJSONString(testTopLevel []*Test) string

ToJSONString converts a test object to its JSON representation.

func ToOrderedJSON

func ToOrderedJSON(testTopLevel []*Test) oj.OJsonObject

ToOrderedJSON converts a test object to an ordered JSON object.

Types

type Account

type Account struct {
	Address      []byte
	Nonce        *big.Int
	Balance      *big.Int
	Storage      []*StorageKeyValuePair
	Code         string
	OriginalCode string
}

Account is a json object representing an account.

func FindAccount

func FindAccount(accounts []*Account, address []byte) *Account

FindAccount searches an account list by address.

type Block

type Block struct {
	Results      []*TransactionResult
	Transactions []*Transaction
	BlockHeader  *BlockHeader
}

Block is a json object representing a block.

type BlockHeader

type BlockHeader struct {
	Beneficiary   *big.Int // "coinbase"
	Difficulty    *big.Int
	Number        *big.Int
	GasLimit      *big.Int
	UnixTimestamp *big.Int
}

BlockHeader is a json object representing the block header.

type LogEntry

type LogEntry struct {
	Address []byte
	Topics  []*big.Int
	Data    []byte
}

LogEntry is a json object representing an expected transaction result log entry.

type StorageKeyValuePair

type StorageKeyValuePair struct {
	Key   []byte
	Value []byte
}

StorageKeyValuePair is a json key value pair in the storage map.

type Test

type Test struct {
	TestName    string
	CheckGas    bool
	Pre         []*Account
	Blocks      []*Block
	Network     string
	BlockHashes [][]byte
	PostState   []*Account
}

Test is a json object representing a test.

func ParseTopLevel

func ParseTopLevel(jsonString []byte) ([]*Test, error)

ParseTopLevel converts json string to object representation

type Transaction

type Transaction struct {
	Nonce         *big.Int
	Value         *big.Int
	IsCreate      bool
	From          []byte
	To            []byte
	Function      string
	ContractCode  string
	AssembledCode string
	Arguments     []*big.Int
	GasPrice      *big.Int
	GasLimit      *big.Int
}

Transaction is a json object representing a transaction.

type TransactionResult

type TransactionResult struct {
	Out        []*big.Int
	Status     *big.Int
	Gas        *big.Int
	Refund     *big.Int
	IgnoreLogs bool
	LogHash    string
	Logs       []*LogEntry
}

TransactionResult is a json object representing an expected transaction result.

Jump to

Keyboard shortcuts

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