Documentation
¶
Index ¶
- func LogToString(logEntry *LogEntry) string
- func ResultAsString(result [][]byte) string
- func ResultEqual(expected, actual []byte) bool
- func ToJSONString(testTopLevel []*Test) string
- func ToOrderedJSON(testTopLevel []*Test) oj.OJsonObject
- type Account
- type Argument
- type Block
- type BlockHeader
- type LogEntry
- type StorageKeyValuePair
- type Test
- type Transaction
- type TransactionResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogToString ¶
LogToString returns a json representation of a log entry, we use it for debugging
func ResultAsString ¶ added in v0.0.8
ResultAsString helps create nicer error messages.
func ResultEqual ¶ added in v0.0.8
ResultEqual returns true if result bytes encode the same number.
func ToJSONString ¶
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 AsyncCallData string }
Account is a json object representing an account.
func FindAccount ¶
FindAccount searches an account list by address.
type Argument ¶ added in v0.0.9
type Argument struct {
// contains filtered or unexported fields
}
Argument encodes an argument in a transaction. Can distinguish values written explicitly as poitive or negative (e.g. -0x01, +0xFF), in order to provide some additional context on how to interpret them in an actual test.
func (Argument) ToBytes ¶ added in v0.0.9
ToBytes yields value as byte array. Can force sign if so specified in the test json.
func (Argument) ToBytesAlwaysForceSign ¶ added in v0.0.9
ToBytesAlwaysForceSign yields value as byte array, always forcing the correct test bit, even if it means adding an extra byte.
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 Timestamp uint64 }
BlockHeader is a json object representing the block header.
type StorageKeyValuePair ¶
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 ¶
ParseTopLevel converts json string to object representation