state

package
v0.0.0-...-f94ef0f Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContractHash

func CreateContractHash(sender common.Address, nonce uint64, codeHash common.Hash) common.Hash

func DecodeLog

func DecodeLog(l *types.Log, r *io.BinReader)

func EncodeLog

func EncodeLog(l *types.Log, w *io.BinWriter)

Types

type Contract

type Contract struct {
	Address  common.Address `json:"address"`
	CodeHash common.Hash    `json:"codeHash"`
	Code     []byte         `json:"code,omitempty"`
}

func (*Contract) DecodeBinary

func (c *Contract) DecodeBinary(br *io.BinReader)

func (*Contract) EncodeBinary

func (c *Contract) EncodeBinary(bw *io.BinWriter)

type MPTRoot

type MPTRoot struct {
	Version byte                `json:"version"`
	Index   uint32              `json:"index"`
	Root    common.Hash         `json:"roothash"`
	Witness transaction.Witness `json:"witnesses"`
}

MPTRoot represents storage state root together with sign info.

func (*MPTRoot) DecodeBinary

func (s *MPTRoot) DecodeBinary(r *io.BinReader)

DecodeBinary implements io.Serializable.

func (*MPTRoot) DecodeBinaryUnsigned

func (s *MPTRoot) DecodeBinaryUnsigned(r *io.BinReader)

DecodeBinaryUnsigned decodes hashable part of state root.

func (*MPTRoot) EncodeBinary

func (s *MPTRoot) EncodeBinary(w *io.BinWriter)

EncodeBinary implements io.Serializable.

func (*MPTRoot) EncodeBinaryUnsigned

func (s *MPTRoot) EncodeBinaryUnsigned(w *io.BinWriter)

EncodeBinaryUnsigned encodes hashable part of state root..

func (*MPTRoot) Hash

func (s *MPTRoot) Hash() common.Hash

Hash returns hash of s.

type NativeContract

type NativeContract struct {
	Name string `json:"name"`
	Contract
	UpdateHistory []uint32 `json:"updatehistory,omitempty"`
	Abi           abi.ABI  `json:"abi"`
	ContractCalls map[string]reflect.Value
}

NativeContract holds information about native contract.

func (*NativeContract) MarshalJSON

func (n *NativeContract) MarshalJSON() ([]byte, error)

type StorageItem

type StorageItem []byte

StorageItem is the value to be stored with read-only flag.

type StorageItemWithKey

type StorageItemWithKey struct {
	Key  []byte
	Item StorageItem
}

StorageItemWithKey is a storage item with corresponding key.

type StorageKey

type StorageKey struct {
	Hash common.Address
	Key  []byte
}

func (*StorageKey) DecodeBinary

func (sk *StorageKey) DecodeBinary(br *io.BinReader)

func (*StorageKey) EncodeBinary

func (sk *StorageKey) EncodeBinary(bw *io.BinWriter)

type Validator

type Validator struct {
	Key   *keys.PublicKey
	Votes *big.Int
}

Validator holds the state of a validator (its key and votes balance).

Jump to

Keyboard shortcuts

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