-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(taiko-client): improve
BlobTransactionBuilder
to support `Blob…
…TxListOffset`
- Loading branch information
1 parent
8c9bdca
commit 6138b8b
Showing
2 changed files
with
69 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/taiko-client/proposer/transaction_builder/blob_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package builder | ||
|
||
import ( | ||
"github.com/ethereum-optimism/optimism/op-service/eth" | ||
|
||
"github.com/taikoxyz/taiko-mono/packages/taiko-client/internal/testutils" | ||
) | ||
|
||
func (s *TransactionBuilderTestSuite) TestBuildBlob() { | ||
tx, err := s.blobTxBuiler.buildOntake([][]byte{{1}}) | ||
s.Nil(err) | ||
s.Equal(1, len(tx.Blobs)) | ||
|
||
tx, err = s.blobTxBuiler.buildOntake([][]byte{{1}, {2}}) | ||
s.Nil(err) | ||
s.Equal(1, len(tx.Blobs)) | ||
|
||
tx, err = s.blobTxBuiler.buildOntake([][]byte{testutils.RandomBytes(eth.MaxBlobDataSize), {2}}) | ||
s.Nil(err) | ||
s.Equal(2, len(tx.Blobs)) | ||
|
||
tx, err = s.blobTxBuiler.buildOntake([][]byte{ | ||
testutils.RandomBytes(eth.MaxBlobDataSize), {2}, {3}, testutils.RandomBytes(eth.MaxBlobDataSize)}, | ||
) | ||
s.Nil(err) | ||
s.Equal(3, len(tx.Blobs)) | ||
} |