Documentation
¶
Index ¶
- func GenerateGenesisActions(genesis []GenesisEntity) []*state.GenesisAction
- func GenerateGenesisActionsEtrog(genesis []GenesisEntityEtrog) []*state.GenesisAction
- type GenesisAccount
- type GenesisEntity
- type GenesisEntityEtrog
- type GenesisSmartContract
- type L1InfoTree
- type L1InfoTreeProof
- type L1Infotree
- type Leaf
- type LeafEtrog
- type LeafV2
- type Overwrite
- type Receipt
- type StateTransitionTestCase
- type StateTransitionTestCaseEtrog
- type StateTransitionTestCaseV2
- type TestReceipt
- type Tx
- type TxEtrog
- type TxEventsSendBatchTestCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateGenesisActions ¶
func GenerateGenesisActions(genesis []GenesisEntity) []*state.GenesisAction
func GenerateGenesisActionsEtrog ¶
func GenerateGenesisActionsEtrog(genesis []GenesisEntityEtrog) []*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 ¶
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 GenesisEntityEtrog ¶
type GenesisEntityEtrog 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"`
}
GenesisEntityEtrog 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 L1InfoTree ¶
type L1InfoTree struct {
PreviousLeafValues []common.Hash `json:"previousLeafValues"`
CurrentRoot common.Hash `json:"currentRoot"`
NewLeafValue common.Hash `json:"newLeafValue"`
NewRoot common.Hash `json:"newRoot"`
}
L1InfoTree holds the test vector for the merkle tree
type L1InfoTreeProof ¶
type L1InfoTreeProof struct {
Leaves []common.Hash `json:"leaves"`
Index uint `json:"index"`
Proof []common.Hash `json:"proof"`
Root common.Hash `json:"root"`
}
L1InfoTree holds the test vector for the merkle tree
type L1Infotree ¶
type L1Infotree struct {
SkipVerifyL1InfoRoot bool `json:"skipVerifyL1InfoRoot"`
}
L1InfoTree represents the state of the L1InfoTree
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 LeafEtrog ¶
type LeafEtrog struct {
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"`
}
LeafEtrog represents the state of a leaf in the merkle tree
type LeafV2 ¶
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 StateTransitionTestCaseEtrog ¶
type StateTransitionTestCaseEtrog struct {
Description string `json:"Description"`
Genesis []GenesisEntityEtrog `json:"genesis"`
ExpectedOldStateRoot string `json:"expectedOldRoot"`
ExpectedNewStateRoot string `json:"expectedNewRoot"`
ExpectedNewLeafs map[string]LeafEtrog `json:"expectedNewLeafs"`
Receipts []TestReceipt `json:"receipts"`
GlobalExitRoot string `json:"globalExitRoot"`
Txs []TxEtrog `json:"txs"`
OldAccInputHash string `json:"oldAccInputHash"`
L1InfoRoot string `json:"l1InfoRoot"`
TimestampLimit string `json:"timestampLimit"`
L1InfoTree L1Infotree `json:"l1InfoTree"`
BatchL2Data string `json:"batchL2Data"`
BatchHashData string `json:"batchHashData"`
ForkID uint64 `json:"forkID"`
SequencerAddress string `json:"sequencerAddress"`
}
StateTransitionTestCaseEtrog holds the metadata needed to run a state transition test
func LoadStateTransitionTestCasesEtrog ¶
func LoadStateTransitionTestCasesEtrog(path string) ([]StateTransitionTestCaseEtrog, error)
LoadStateTransitionTestCasesEtrog loads the state-transition tests cases
type StateTransitionTestCaseV2 ¶
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 ¶
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 TxEtrog ¶
type TxEtrog struct {
Type uint `json:"type"`
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"`
CustomRawTx string `json:"customRawTx"`
Overwrite Overwrite `json:"overwrite"`
EncodeInvalidData bool `json:"encodeInvalidData"`
Reason string `json:"reason"`
IndexL1InfoTree uint32 `json:"indexL1InfoTree"`
}
TxEtrog 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"`
PolAmount string `json:"polAmount"`
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