Skip to content

Commit

Permalink
stashing
Browse files Browse the repository at this point in the history
  • Loading branch information
badgersrus committed Sep 16, 2024
1 parent abd77aa commit 674c7e8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
5 changes: 1 addition & 4 deletions integration/ethereummock/mgmt_contract_lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,7 @@ func decodeTx(tx *types.Transaction) ethadapter.L1Transaction {
var t ethadapter.L1Transaction
switch tx.To().Hex() {
case rollupTxAddr.Hex():
{
t = &ethadapter.L1RollupHashes{}
println("FOUND L1ROLLUPHASHES")
}
t = &ethadapter.L1RollupHashes{}
case storeSecretTxAddr.Hex():
t = &ethadapter.L1RespondSecretTx{}
case depositTxAddr.Hex():
Expand Down
9 changes: 3 additions & 6 deletions integration/ethereummock/mock_l1_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,9 @@ func printBlock(b *types.Block, m *Node) string {
}

switch l1Tx := t.(type) {
case *ethadapter.L1RollupTx:
r, err := common.DecodeRollup(l1Tx.Rollup)
if err != nil {
testlog.Logger().Crit("failed to decode rollup")
}
txs = append(txs, fmt.Sprintf("r_%d(nonce=%d)", common.ShortHash(r.Hash()), tx.Nonce()))
case *ethadapter.L1RollupHashes:
blobHashes := l1Tx.BlobHashes
txs = append(txs, fmt.Sprintf("r_%d(nonce=%d)", common.ShortHash(blobHashes[0]), tx.Nonce()))

case *ethadapter.L1DepositTx:
var to uint64
Expand Down
7 changes: 3 additions & 4 deletions integration/ethereummock/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ func (m *Node) SendTransaction(tx *types.Transaction) error {
return nil
}

func (m *Node) TransactionReceipt(_ gethcommon.Hash) (*types.Receipt, error) {
func (m *Node) TransactionReceipt(hash gethcommon.Hash) (*types.Receipt, error) {
println("TransactionReceipt: ", hash.Hex())
// all transactions are immediately processed
return &types.Receipt{
BlockNumber: big.NewInt(1),
Expand All @@ -156,9 +157,7 @@ func (m *Node) getRollupFromBlock(block *types.Block) *common.ExtRollup {
}
switch l1tx := decodedTx.(type) {
case *ethadapter.L1RollupHashes:
blobHashes := l1tx.BlobHashes
println("Blob hashes: ", blobHashes)
println("MockGenesisBlock.Time()", MockGenesisBlock.Time())
println(l1tx)
slot, err := ethadapter.TimeToSlot(block.Time(), MockGenesisBlock.Time(), uint64(12))
if err != nil {
m.logger.Error("Failed to calculate slot", "error", err)
Expand Down
2 changes: 1 addition & 1 deletion integration/simulation/simulation_in_mem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestInMemoryMonteCarloSimulation(t *testing.T) {
setupSimTestLog("in-mem")

// todo (#718) - try increasing this back to 7 once faster-finality model is optimised
numberOfNodes := 5
numberOfNodes := 2
numberOfSimWallets := 10
wallets := params.NewSimWallets(numberOfSimWallets, numberOfNodes, integration.EthereumChainID, integration.TenChainID)

Expand Down

0 comments on commit 674c7e8

Please sign in to comment.