From aabdd1414bb0254df03597a6168732e32cbe8f23 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 15 Jan 2025 15:54:57 +0800 Subject: [PATCH] feat: fix tests --- .../driver/chain_syncer/blob/syncer.go | 2 +- .../taiko-client/driver/txlist_fetcher/blob.go | 2 +- .../driver/txlist_fetcher/calldata.go | 2 +- .../driver/txlist_fetcher/interface.go | 2 +- .../taiko-client/pkg/rpc/subscription_test.go | 18 +++++++++--------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/taiko-client/driver/chain_syncer/blob/syncer.go b/packages/taiko-client/driver/chain_syncer/blob/syncer.go index ac33313a77..bc4653ab31 100644 --- a/packages/taiko-client/driver/chain_syncer/blob/syncer.go +++ b/packages/taiko-client/driver/chain_syncer/blob/syncer.go @@ -276,7 +276,7 @@ func (s *Syncer) onBlockProposedOntake( } else { txListFetcher = txlistFetcher.NewCalldataFetch(s.rpc) } - txListBytes, err := txListFetcher.Fetch(ctx, tx, meta) + txListBytes, err := txListFetcher.FetchOntake(ctx, tx, meta) if err != nil { return fmt.Errorf("failed to fetch tx list: %w", err) } diff --git a/packages/taiko-client/driver/txlist_fetcher/blob.go b/packages/taiko-client/driver/txlist_fetcher/blob.go index a397c4ea26..a63425af99 100644 --- a/packages/taiko-client/driver/txlist_fetcher/blob.go +++ b/packages/taiko-client/driver/txlist_fetcher/blob.go @@ -27,7 +27,7 @@ func NewBlobTxListFetcher(l1Beacon *rpc.BeaconClient, ds *rpc.BlobDataSource) *B } // Fetch implements the TxListFetcher interface. -func (d *BlobFetcher) Fetch( +func (d *BlobFetcher) FetchOntake( ctx context.Context, _ *types.Transaction, meta metadata.TaikoBlockMetaDataOntake, diff --git a/packages/taiko-client/driver/txlist_fetcher/calldata.go b/packages/taiko-client/driver/txlist_fetcher/calldata.go index 367bfe339a..8c1a9bc497 100644 --- a/packages/taiko-client/driver/txlist_fetcher/calldata.go +++ b/packages/taiko-client/driver/txlist_fetcher/calldata.go @@ -24,7 +24,7 @@ func NewCalldataFetch(rpc *rpc.Client) *CalldataFetcher { } // Fetch fetches the txList bytes from the transaction's calldata. -func (d *CalldataFetcher) Fetch( +func (d *CalldataFetcher) FetchOntake( ctx context.Context, tx *types.Transaction, meta metadata.TaikoBlockMetaDataOntake, diff --git a/packages/taiko-client/driver/txlist_fetcher/interface.go b/packages/taiko-client/driver/txlist_fetcher/interface.go index 6d6c50bd0d..8662377433 100644 --- a/packages/taiko-client/driver/txlist_fetcher/interface.go +++ b/packages/taiko-client/driver/txlist_fetcher/interface.go @@ -10,5 +10,5 @@ import ( // TxListFetcher is responsible for fetching the L2 txList bytes from L1 type TxListFetcher interface { - Fetch(ctx context.Context, tx *types.Transaction, meta metadata.TaikoBlockMetaDataOntake) ([]byte, error) + FetchOntake(ctx context.Context, tx *types.Transaction, meta metadata.TaikoBlockMetaDataOntake) ([]byte, error) } diff --git a/packages/taiko-client/pkg/rpc/subscription_test.go b/packages/taiko-client/pkg/rpc/subscription_test.go index c7ca318918..ed36f7c011 100644 --- a/packages/taiko-client/pkg/rpc/subscription_test.go +++ b/packages/taiko-client/pkg/rpc/subscription_test.go @@ -17,31 +17,31 @@ func TestSubscribeEvent(t *testing.T) { })) } -func TestSubscribeBlockVerified(t *testing.T) { - require.NotNil(t, SubscribeBlockVerified( +func TestSubscribeBlockVerifiedV2(t *testing.T) { + require.NotNil(t, SubscribeBlockVerifiedV2( newTestClient(t).OntakeClients.TaikoL1, - make(chan *ontakeBindings.TaikoL1ClientBlockVerified, 1024)), + make(chan *ontakeBindings.TaikoL1ClientBlockVerifiedV2, 1024)), ) } func TestSubscribeBlockProposed(t *testing.T) { - require.NotNil(t, SubscribeBlockProposed( + require.NotNil(t, SubscribeBlockProposedV2( newTestClient(t).OntakeClients.TaikoL1, - make(chan *ontakeBindings.TaikoL1ClientBlockProposed, 1024)), + make(chan *ontakeBindings.TaikoL1ClientBlockProposedV2, 1024)), ) } func TestSubscribeTransitionProved(t *testing.T) { - require.NotNil(t, SubscribeTransitionProved( + require.NotNil(t, SubscribeTransitionProvedV2( newTestClient(t).OntakeClients.TaikoL1, - make(chan *ontakeBindings.TaikoL1ClientTransitionProved, 1024)), + make(chan *ontakeBindings.TaikoL1ClientTransitionProvedV2, 1024)), ) } func TestSubscribeTransitionContested(t *testing.T) { - require.NotNil(t, SubscribeTransitionContested( + require.NotNil(t, SubscribeTransitionContestedV2( newTestClient(t).OntakeClients.TaikoL1, - make(chan *ontakeBindings.TaikoL1ClientTransitionContested, 1024)), + make(chan *ontakeBindings.TaikoL1ClientTransitionContestedV2, 1024)), ) }