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

Commit

Permalink
fix based on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
YoGhurt111 committed Apr 8, 2024
1 parent e8780e2 commit 2617985
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 49 deletions.
6 changes: 3 additions & 3 deletions driver/txlist_fetcher/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/ethereum/go-ethereum/log"

"github.com/taikoxyz/taiko-client/bindings"
"github.com/taikoxyz/taiko-client/pkg/customerr"
"github.com/taikoxyz/taiko-client/pkg"
"github.com/taikoxyz/taiko-client/pkg/rpc"
)

Expand All @@ -33,7 +33,7 @@ func (d *BlobFetcher) Fetch(
meta *bindings.TaikoDataBlockMetadata,
) ([]byte, error) {
if !meta.BlobUsed {
return nil, customerr.ErrBlobUsed
return nil, pkg.ErrBlobUsed
}

// Fetch the L1 block sidecars.
Expand Down Expand Up @@ -63,5 +63,5 @@ func (d *BlobFetcher) Fetch(
}
}

return nil, customerr.ErrSidecarNotFound
return nil, pkg.ErrSidecarNotFound
}
4 changes: 2 additions & 2 deletions driver/txlist_fetcher/calldata.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/taikoxyz/taiko-client/bindings"
"github.com/taikoxyz/taiko-client/bindings/encoding"
"github.com/taikoxyz/taiko-client/pkg/customerr"
"github.com/taikoxyz/taiko-client/pkg"
)

// CalldataFetcher is responsible for fetching the txList bytes from the transaction's calldata.
Expand All @@ -19,7 +19,7 @@ func (d *CalldataFetcher) Fetch(
meta *bindings.TaikoDataBlockMetadata,
) ([]byte, error) {
if meta.BlobUsed {
return nil, customerr.ErrBlobUsed
return nil, pkg.ErrBlobUsed
}

return encoding.UnpackTxListBytes(tx.Data())
Expand Down
2 changes: 1 addition & 1 deletion pkg/customerr/custom_error.go → pkg/error.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package customerr
package pkg

import (
"errors"
Expand Down
6 changes: 3 additions & 3 deletions pkg/rpc/blob_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/go-resty/resty/v2"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/blob"
"github.com/taikoxyz/taiko-client/bindings"
"github.com/taikoxyz/taiko-client/pkg/customerr"
"github.com/taikoxyz/taiko-client/pkg"
)

type BlobDataSource struct {
Expand Down Expand Up @@ -47,15 +47,15 @@ func (ds *BlobDataSource) GetBlobs(
meta *bindings.TaikoDataBlockMetadata,
) ([]*blob.Sidecar, error) {
if !meta.BlobUsed {
return nil, customerr.ErrBlobUnused
return nil, pkg.ErrBlobUnused
}

var (
sidecars []*blob.Sidecar
err error
)
if ds.client.L1Beacon == nil {
sidecars, err = nil, customerr.ErrBeaconNotFound
sidecars, err = nil, pkg.ErrBeaconNotFound
} else {
sidecars, err = ds.client.L1Beacon.GetBlobs(ctx, meta.Timestamp)
}
Expand Down
40 changes: 0 additions & 40 deletions pkg/rpc/blob_datasource_test.go

This file was deleted.

0 comments on commit 2617985

Please sign in to comment.