genesis

package
v0.15.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenesisStateDiff

func GenesisStateDiff(
	config *GenesisConfig,
	v vm.VM,
	network *utils.Network,
	maxSteps uint64,
) (core.StateDiff, map[felt.Felt]core.Class, error)

GenesisStateDiff builds the genesis state given the genesis-config data.

Types

type Account

type Account struct {
	Address felt.Felt `json:"address"`
	PubKey  felt.Felt `json:"publicKey"`
	PrivKey felt.Felt `json:"privateKey"`
}

type FunctionCall

type FunctionCall struct {
	ContractAddress    felt.Felt   `json:"contract_address"`
	EntryPointSelector felt.Felt   `json:"entry_point_selector"`
	Calldata           []felt.Felt `json:"calldata"`
}

type GenesisConfig

type GenesisConfig struct {
	Classes           []string                          `json:"classes"`            // []path-to-class.json
	Contracts         map[felt.Felt]GenesisContractData `json:"contracts"`          // address -> {classHash, constructorArgs}
	FunctionCalls     []FunctionCall                    `json:"function_calls"`     // list of functionCalls to Call()
	BootstrapAccounts []Account                         `json:"bootstrap_accounts"` // accounts to prefund with strk token
	Txns              []rpc.Transaction                 `json:"transactions"`       // Declare NOT supported
}

func Read

func Read(path string) (*GenesisConfig, error)

func (*GenesisConfig) UnmarshalJSON

func (g *GenesisConfig) UnmarshalJSON(data []byte) error

func (*GenesisConfig) Validate

func (g *GenesisConfig) Validate() error

type GenesisContractData

type GenesisContractData struct {
	ClassHash       felt.Felt   `json:"class_hash"`
	ConstructorArgs []felt.Felt `json:"constructor_args"`
}

Jump to

Keyboard shortcuts

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