Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions op-acceptance-tests/tests/fjord/check_scripts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func checkFastLZTransactions(t devtest.T, ctx context.Context, sys *presets.Mini
fastLzSize := uint64(types.FlzCompressLen(txUnsigned) + 68)
gethGPOFee, err := dsl.CalculateFjordL1Cost(ctx, l2Client, types.RollupCostData{FastLzSize: fastLzSize}, receipt.BlockHash)
require.NoError(err)
require.Equal(gethGPOFee.Uint64(), gpoFee.Uint64())
Comment thread
serpixel marked this conversation as resolved.
require.Equalf(gethGPOFee.Uint64(), gpoFee.Uint64(), "GPO L1 fee mismatch (expected=%d actual=%d)", gethGPOFee.Uint64(), gpoFee.Uint64())

expectedFee, err := dsl.CalculateFjordL1Cost(ctx, l2Client, signedTx.RollupCostData(), receipt.BlockHash)
require.NoError(err)
Expand All @@ -178,7 +178,7 @@ func checkFastLZTransactions(t devtest.T, ctx context.Context, sys *presets.Mini
flzUpperBound := uint64(txLenGPO + txLenGPO/255 + 16)
upperBoundCost, err := dsl.CalculateFjordL1Cost(ctx, l2Client, types.RollupCostData{FastLzSize: flzUpperBound}, receipt.BlockHash)
require.NoError(err)
require.Equal(upperBoundCost.Uint64(), upperBound.Uint64())
require.Equalf(upperBoundCost.Uint64(), upperBound.Uint64(), "GPO L1 upper bound mismatch (expected=%d actual=%d)", upperBoundCost.Uint64(), upperBound.Uint64())

_, err = contractio.Read(gasPriceOracle.BaseFeeScalar(), ctx)
require.NoError(err)
Expand Down
96 changes: 0 additions & 96 deletions op-acceptance-tests/tests/interop/interop_smoke_test.go

This file was deleted.

89 changes: 89 additions & 0 deletions op-acceptance-tests/tests/interop/smoke/interop_smoke_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package smoke

import (
"testing"

"github.com/ethereum-optimism/optimism/op-devstack/devtest"
"github.com/ethereum-optimism/optimism/op-devstack/presets"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/predeploys"
txib "github.com/ethereum-optimism/optimism/op-service/txintent/bindings"
"github.com/ethereum-optimism/optimism/op-service/txintent/contractio"
"github.com/ethereum/go-ethereum/core/types"
)

func TestInteropSystemNoop(gt *testing.T) {
t := devtest.SerialT(gt)
_ = presets.NewMinimal(t)
t.Log("noop")
}

func TestSmokeTest(gt *testing.T) {
t := devtest.SerialT(gt)
sys := presets.NewMinimal(t)
require := t.Require()
ctx := t.Ctx()

user := sys.FunderL2.NewFundedEOA(eth.OneTenthEther)

l2Client := sys.L2EL.Escape().EthClient()
weth := txib.NewBindings[txib.WETH](
txib.WithClient(l2Client),
txib.WithTo(predeploys.WETHAddr),
txib.WithTest(t),
)

initialBalance, err := contractio.Read(weth.BalanceOf(user.Address()), ctx)
require.NoError(err)
t.Logf("Initial WETH balance: %s", initialBalance)

depositAmount := eth.OneHundredthEther

tx := user.Transfer(predeploys.WETHAddr, depositAmount)
receipt, err := tx.Included.Eval(ctx)
require.NoError(err)
require.Equal(types.ReceiptStatusSuccessful, receipt.Status)
t.Logf("Deposited %s ETH to WETH contract", depositAmount)

finalBalance, err := contractio.Read(weth.BalanceOf(user.Address()), ctx)
require.NoError(err)
t.Logf("Final WETH balance: %s", finalBalance)

expectedBalance := initialBalance.Add(depositAmount)
require.Equal(expectedBalance, finalBalance, "WETH balance should have increased by deposited amount")
}

func TestSmokeTestFailure(gt *testing.T) {
t := devtest.SerialT(gt)
sys := presets.NewMinimal(t)
require := t.Require()
ctx := t.Ctx()

user := sys.FunderL2.NewFundedEOA(eth.OneTenthEther)

l2Client := sys.L2EL.Escape().EthClient()
weth := txib.NewBindings[txib.WETH](
txib.WithClient(l2Client),
txib.WithTo(predeploys.WETHAddr),
txib.WithTest(t),
)

initialBalance, err := contractio.Read(weth.BalanceOf(user.Address()), ctx)
require.NoError(err)
t.Logf("Initial WETH balance: %s", initialBalance)

depositAmount := eth.OneEther

userBalance := user.GetBalance()
t.Logf("User balance: %s", userBalance)

require.True(userBalance.Lt(depositAmount), "user should have insufficient funds for this transaction")

t.Logf("user has insufficient funds: balance=%s, required=%s", userBalance, depositAmount)

finalBalance, err := contractio.Read(weth.BalanceOf(user.Address()), ctx)
require.NoError(err)
t.Logf("Final WETH balance: %s", finalBalance)

require.Equal(initialBalance, finalBalance, "WETH balance should not have changed")
}