accounts

package
v0.0.0-...-1f8a15b Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MimetypeDataWithValidator = "data/validator"
	MimetypeTypedData         = "data/typed"
	MimetypeClique            = "application/x-clique-header"
	MimetypeBor               = "application/x-bor-header"
	MimetypeTextPlain         = "text/plain"
)

Variables

This section is empty.

Functions

func ConvertV2toV3

func ConvertV2toV3(v []byte) ([]byte, error)

func ConvertV3toV2

func ConvertV3toV2(v []byte) ([]byte, error)

func DecodeIncarnationFromStorage

func DecodeIncarnationFromStorage(enc []byte) (uint64, error)

func DeserialiseV3

func DeserialiseV3(a *Account, enc []byte) error

DeserialiseV3 - method to deserialize accounts in Erigon22 history

func IsEmptyCodeHash

func IsEmptyCodeHash(codeHash libcommon.Hash) bool

func SerialiseV3

func SerialiseV3(a *Account) []byte

func SerialiseV3Len

func SerialiseV3Len(a *Account) (l int)

func SerialiseV3To

func SerialiseV3To(a *Account, value []byte)

Types

type AccProofResult

type AccProofResult struct {
	Address      libcommon.Address  `json:"address"`
	AccountProof []hexutility.Bytes `json:"accountProof"`
	Balance      *hexutil.Big       `json:"balance"`
	CodeHash     libcommon.Hash     `json:"codeHash"`
	Nonce        hexutil.Uint64     `json:"nonce"`
	StorageHash  libcommon.Hash     `json:"storageHash"`
	StorageProof []StorProofResult  `json:"storageProof"`
}

Result structs for GetProof

type Account

type Account struct {
	Initialised bool
	Nonce       uint64
	Balance     uint256.Int
	Root        libcommon.Hash // merkle root of the storage trie
	CodeHash    libcommon.Hash // hash of the bytecode
	Incarnation uint64
}

Account is the Ethereum consensus representation of accounts. These objects are stored in the main account trie. DESCRIBED: docs/programmers_guide/guide.md#ethereum-state

func NewAccount

func NewAccount() Account

NewAccount creates a new account w/o code nor storage.

func (*Account) Copy

func (a *Account) Copy(image *Account)

Copy makes `a` a full, independent (meaning that if the `image` changes in any way, it does not affect `a`) copy of the account `image`.

func (*Account) DecodeForHashing

func (a *Account) DecodeForHashing(enc []byte) error

func (*Account) DecodeForStorage

func (a *Account) DecodeForStorage(enc []byte) error

func (*Account) DecodeRLP

func (a *Account) DecodeRLP(s *rlp.Stream) error

func (*Account) EncodeForHashing

func (a *Account) EncodeForHashing(buffer []byte)

func (*Account) EncodeForStorage

func (a *Account) EncodeForStorage(buffer []byte)

func (*Account) EncodeRLP

func (a *Account) EncodeRLP(w io.Writer) error

func (*Account) EncodingLengthForHashing

func (a *Account) EncodingLengthForHashing() uint

func (*Account) EncodingLengthForStorage

func (a *Account) EncodingLengthForStorage() uint

func (*Account) Equals

func (a *Account) Equals(acc *Account) bool

func (*Account) GetIncarnation

func (a *Account) GetIncarnation() uint64

func (*Account) IsEmptyCodeHash

func (a *Account) IsEmptyCodeHash() bool

func (*Account) IsEmptyRoot

func (a *Account) IsEmptyRoot() bool

func (*Account) Reset

func (a *Account) Reset()

func (*Account) SelfCopy

func (a *Account) SelfCopy() *Account

func (*Account) SetIncarnation

func (a *Account) SetIncarnation(v uint64)

type StorProofResult

type StorProofResult struct {
	Key   libcommon.Hash     `json:"key"`
	Value *hexutil.Big       `json:"value"`
	Proof []hexutility.Bytes `json:"proof"`
}

Jump to

Keyboard shortcuts

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