Documentation ¶
Index ¶
- func GenerateGenesisActions(genesis []GenesisEntity) []*state.GenesisAction
- type GenesisAccount
- type GenesisEntity
- type GenesisSmartContract
- type Leaf
- type LeafV2
- type Overwrite
- type Receipt
- type StateTransitionTestCase
- type StateTransitionTestCaseV2
- type TestReceipt
- type Tx
- type TxEventsSendBatchTestCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateGenesisActions ¶ added in v0.0.990
func GenerateGenesisActions(genesis []GenesisEntity) []*state.GenesisAction
Types ¶
type GenesisAccount ¶
type GenesisAccount struct { Address string `json:"address"` PvtKey string `json:"pvtKey"` Balance argBigInt `json:"balance"` Nonce string `json:"nonce"` }
GenesisAccount represents the state of an account when the network starts
type GenesisEntity ¶ added in v0.0.990
type GenesisEntity struct { Address string `json:"address"` PvtKey *string `json:"pvtKey"` Balance argBigInt `json:"balance"` Nonce string `json:"nonce"` Storage map[string]string `json:"storage"` IsSmartContract bool `json:"isSmartContract"` Bytecode *string `json:"bytecode"` }
GenesisEntity represents the state of an account or smart contract when the network starts
type GenesisSmartContract ¶
GenesisSmartContract represents the smart contract to init when the network starts
type Leaf ¶
type Leaf struct { Balance argBigInt `json:"balance"` Nonce string `json:"nonce"` }
Leaf represents the state of a leaf in the merkle tree
type LeafV2 ¶ added in v0.0.990
type LeafV2 struct { Address string `json:"address"` Balance argBigInt `json:"balance"` Nonce string `json:"nonce"` Storage map[string]string `json:"storage"` IsSmartContract bool `json:"isSmartContract"` Bytecode string `json:"bytecode"` HashBytecode string `json:"hashBytecode"` BytecodeLength int `json:"bytecodeLength"` }
LeafV2 represents the state of a leaf in the merkle tree
type Overwrite ¶
type Overwrite struct {
S string `json:"s"`
}
Overwrite is used by Protocol team for testing
type Receipt ¶
type Receipt struct { TransactionHash string `json:"transactionHash"` TransactionIndex uint `json:"transactionIndex"` BlockNumber uint64 `json:"blockNumber"` From string `json:"from"` To string `json:"to"` CumulativeGastUsed uint64 `json:"cumulativeGasUsed"` GasUsedForTx uint64 `json:"gasUsedForTx"` ContractAddress string `json:"contractAddress"` Logs uint64 `json:"logs"` LogsBloom uint64 `json:"logsBloom"` Status uint64 `json:"status"` BlockHash string `json:"blockHash"` }
Receipt is the receipt used for receipts tests
type StateTransitionTestCase ¶
type StateTransitionTestCase struct { ID uint `json:"id"` Description string `json:"description"` ChainIDSequencer uint64 `json:"chainIdSequencer"` SequencerAddress string `json:"sequencerAddress"` SequencerPrivateKey string `json:"sequencerPvtKey"` GenesisAccounts []GenesisAccount `json:"genesis"` GenesisSmartContracts []GenesisSmartContract `json:"genesisSC"` ExpectedOldRoot string `json:"expectedOldRoot"` Txs []Tx `json:"txs"` ExpectedNewRoot string `json:"expectedNewRoot"` ExpectedNewLeafs map[string]Leaf `json:"expectedNewLeafs"` Receipts []TestReceipt `json:"receipts"` GlobalExitRoot string `json:"globalExitRoot"` }
StateTransitionTestCase holds the metadata needed to run a state transition test
func LoadStateTransitionTestCases ¶
func LoadStateTransitionTestCases(path string) ([]StateTransitionTestCase, error)
LoadStateTransitionTestCases loads the state-transition.json into a StateTransitionVector instance
type StateTransitionTestCaseV2 ¶ added in v0.0.990
type StateTransitionTestCaseV2 struct { Description string `json:"Description"` Genesis []GenesisEntity `json:"genesis"` ExpectedOldStateRoot string `json:"expectedOldStateRoot"` ExpectedNewStateRoot string `json:"expectedNewStateRoot"` ExpectedNewLeafs []LeafV2 `json:"expectedNewLeafs"` Receipts []TestReceipt `json:"receipts"` GlobalExitRoot string `json:"globalExitRoot"` BatchL2Data string `json:"batchL2Data"` }
StateTransitionTestCaseV2 holds the metadata needed to run a state transition test
func LoadStateTransitionTestCaseV2 ¶ added in v0.0.990
func LoadStateTransitionTestCaseV2(path string) (StateTransitionTestCaseV2, error)
LoadStateTransitionTestCaseV2 loads the state-transition JSON file into a StateTransitionTestCaseV2 instance
type TestReceipt ¶
TestReceipt holds the metadata needed to run the receipt tests
type Tx ¶
type Tx struct { ID uint `json:"id"` From string `json:"from"` To string `json:"to"` Nonce uint64 `json:"nonce"` Value *big.Float `json:"value"` GasLimit uint64 `json:"gasLimit"` GasPrice *big.Float `json:"gasPrice"` ChainID uint64 `json:"chainId"` RawTx string `json:"rawTx"` Overwrite Overwrite `json:"overwrite"` EncodeInvalidData bool `json:"encodeInvalidData"` Reason string `json:"reason"` }
Tx represents a transactions that will be applied during the test
type TxEventsSendBatchTestCase ¶
type TxEventsSendBatchTestCase struct { ID uint `json:"id"` Txs []Tx `json:"txs"` BatchL2Data string `json:"batchL2Data"` BatchHashData common.Hash `json:"batchHashData"` MaticAmount string `json:"maticAmount"` FullCallData string `json:"fullCallData"` }
TxEventsSendBatchTestCase holds the metadata needed to run a etherman test
func LoadTxEventsSendBatchTestCases ¶
func LoadTxEventsSendBatchTestCases(path string) ([]TxEventsSendBatchTestCase, error)
LoadTxEventsSendBatchTestCases loads the calldata-test-vector.json