Skip to content

Commit

Permalink
feat(taiko-client): update BlockParamsV2 struct (#17893)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Aug 8, 2024
1 parent 6972dea commit a1043a8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
6 changes: 6 additions & 0 deletions packages/taiko-client/bindings/encoding/custom_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ func getErrorData(err error) string {
return errData
}
}

// Anvil node custom errors with reasons, example:
// execution reverted: custom error 1a83d90e:, reason: 0x1a83d90e"
if strings.Contains(err.Error(), "custom error") && strings.Contains(err.Error(), "reason") {
return "0x" + err.Error()[len(err.Error())-8:len(err.Error())]
}
// Anvil node custom errors, example:
// "execution reverted: custom error 712eb087:"
if strings.Contains(err.Error(), "custom error") {
Expand Down
4 changes: 0 additions & 4 deletions packages/taiko-client/bindings/encoding/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ var (
Name: "coinbase",
Type: "address",
},
{
Name: "extraData",
Type: "bytes32",
},
{
Name: "parentMetaHash",
Type: "bytes32",
Expand Down
1 change: 0 additions & 1 deletion packages/taiko-client/bindings/encoding/struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ type BlockParams struct {
// BlockParamsV2 should be same with TaikoData.BlockParamsV2.
type BlockParamsV2 struct {
Coinbase common.Address
ExtraData [32]byte
ParentMetaHash [32]byte
AnchorBlockId uint64
Timestamp uint64
Expand Down
1 change: 0 additions & 1 deletion packages/taiko-client/proposer/transaction_builder/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ func (b *BlobTransactionBuilder) Build(

if encodedParams, err = encoding.EncodeBlockParamsOntake(&encoding.BlockParamsV2{
Coinbase: b.l2SuggestedFeeRecipient,
ExtraData: rpc.StringToBytes32(b.extraData),
ParentMetaHash: parentMetaHash,
AnchorBlockId: 0,
Timestamp: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ func (b *CalldataTransactionBuilder) Build(

if encodedParams, err = encoding.EncodeBlockParamsOntake(&encoding.BlockParamsV2{
Coinbase: b.l2SuggestedFeeRecipient,
ExtraData: rpc.StringToBytes32(b.extraData),
ParentMetaHash: parentMetaHash,
AnchorBlockId: 0,
Timestamp: 0,
Expand Down

0 comments on commit a1043a8

Please sign in to comment.