state

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateTrieHeight   = 251
	StorageTrieHeight = 251
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractState

type ContractState struct {
	ContractHash *felt.Felt
	StorageRoot  *felt.Felt
}

func (*ContractState) Hash

func (c *ContractState) Hash() *felt.Felt

type Slot

type Slot struct {
	Key   *felt.Felt
	Value *felt.Felt
}

type State

type State interface {
	Root() *felt.Felt
	GetContractState(address *felt.Felt) (*ContractState, error)
	GetContract(address *felt.Felt) (*types.Contract, error)
	SetContract(address *felt.Felt, hash *felt.Felt, code *types.Contract) error
	GetSlot(address *felt.Felt, slot *felt.Felt) (*felt.Felt, error)
	SetSlots(address *felt.Felt, slots []Slot) error
	GetClassHash(address *felt.Felt) (*felt.Felt, error)
}

func New

func New(manager StateManager, root *felt.Felt) State

type StateManager

type StateManager interface {
	trie.TrieManager
	GetContractState(*felt.Felt) (*ContractState, error)
	PutContractState(*ContractState) error
	PutContract(*felt.Felt, *types.Contract) error
	GetContract(*felt.Felt) (*types.Contract, error)
}

Jump to

Keyboard shortcuts

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