Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
test(proposer): change tests to send blob transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
YoGhurt111 committed May 7, 2024
1 parent da5ad24 commit 5190ce6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
2 changes: 2 additions & 0 deletions internal/docker/nodes/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
- "8545"
entrypoint:
- anvil
- --chain-id
- "32301"
- --host
- "0.0.0.0"
- --hardfork
Expand Down
19 changes: 3 additions & 16 deletions proposer/proposer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"testing"
"time"

"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
Expand Down Expand Up @@ -87,6 +86,8 @@ func (s *ProposerTestSuite) SetupTest() {
MaxTierFeePriceBumps: 3,
ExtraData: "test",
L1BlockBuilderTip: common.Big0,
BlobAllowed: true,
ProposeBlockTxGasLimit: 10000000,
TxmgrConfigs: &txmgr.CLIConfig{
L1RPCURL: os.Getenv("L1_NODE_WS_ENDPOINT"),
NumConfirmations: 0,
Expand Down Expand Up @@ -178,22 +179,15 @@ func (s *ProposerTestSuite) TestProposeTxLists() {
}

// trigger the error
candidate.Blobs = []*eth.Blob{}
candidate.GasLimit = 10000000

txCandidates[i] = *candidate
}

var errors []error
for _, txCandidate := range txCandidates {
receipt, err := p.txmgr.Send(ctx, txCandidate)
s.Nil(err)
errors = append(errors, encoding.TryParsingCustomErrorFromReceipt(ctx, p.rpc.L1, p.proposerAddress, receipt))
}

// confirm errors handled
for _, err := range errors {
s.Equal("L1_BLOB_NOT_AVAILABLE", err.Error())
s.Nil(encoding.TryParsingCustomErrorFromReceipt(ctx, p.rpc.L1, p.proposerAddress, receipt))
}
}

Expand Down Expand Up @@ -260,9 +254,6 @@ func (s *ProposerTestSuite) TestProposeOpNoEmptyBlock() {
s.Nil(err)
s.Equal(true, len(preBuiltTxList) > 0)

txsCh, err := s.getLatestProposedTxs(len(preBuiltTxList), time.Minute)
s.Nil(err)

var (
blockMinGasLimit uint64 = math.MaxUint64
blockMinTxListBytes uint64 = math.MaxUint64
Expand Down Expand Up @@ -290,10 +281,6 @@ func (s *ProposerTestSuite) TestProposeOpNoEmptyBlock() {
p.MinProposingInternal = time.Minute
s.Nil(p.ProposeOp(context.Background()))

txs := <-txsCh
for i := 0; i < len(txLists); i++ {
s.Equal(txLists[i].Len(), txs[i].Len())
}
}

func (s *ProposerTestSuite) TestName() {
Expand Down
2 changes: 1 addition & 1 deletion proposer/transaction_builder/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *TransactionBuilderTestSuite) SetupTest() {
common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")),
common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")),
common.HexToAddress(os.Getenv("ASSIGNMENT_HOOK_ADDRESS")),
0,
10000000,
"test",
)
}
Expand Down

0 comments on commit 5190ce6

Please sign in to comment.