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

Commit

Permalink
Merge branch 'main' into remove-pool-content-splitter
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Feb 22, 2023
2 parents 96f2cf3 + e124fbb commit 53b9872
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.3.0"
".": "0.4.0"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [0.4.0](https://github.com/taikoxyz/taiko-client/compare/v0.3.0...v0.4.0) (2023-02-22)


### Features

* **all:** update contract bindings && some improvements based on Alex's feedback ([#153](https://github.com/taikoxyz/taiko-client/issues/153)) ([bdaa292](https://github.com/taikoxyz/taiko-client/commit/bdaa2920bcb113d3887409edb17462b5e0d3a2c5))
* **bindings:** parse solidity custom errors ([#163](https://github.com/taikoxyz/taiko-client/issues/163)) ([9a79127](https://github.com/taikoxyz/taiko-client/commit/9a79127a5a3cddf4e95ac899943e6551b02cf432))


### Bug Fixes

* **driver:** fix an issue in sync status checking ([#162](https://github.com/taikoxyz/taiko-client/issues/162)) ([4b21027](https://github.com/taikoxyz/taiko-client/commit/4b2102720e2c1c2fcaef1853ad74b91c6d08aaaa))
* **proposer:** fix a proposer nonce order issue ([#157](https://github.com/taikoxyz/taiko-client/issues/157)) ([80fc0e9](https://github.com/taikoxyz/taiko-client/commit/80fc0e94d819f93ecdeac492eb1f35d5f2bb09ce))

## [0.3.0](https://github.com/taikoxyz/taiko-client/compare/v0.2.4...v0.3.0) (2023-02-15)


Expand Down
2 changes: 1 addition & 1 deletion bindings/.githead
Original file line number Diff line number Diff line change
@@ -1 +1 @@
796a13fe713b82afa813d4c27eb5559b66bd89e9
16993cdb081b831420c7e86d981afd11726197d1
50 changes: 50 additions & 0 deletions bindings/error/error.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package error

import (
"encoding/json"
"errors"
"fmt"

"github.com/ethereum/go-ethereum/crypto"
)

// Taken from: https://github.com/ethereum/go-ethereum/blob/master/rpc/json.go
type JsonRPCError struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}

// Error implements the Go error interface.
func (err *JsonRPCError) Error() string {
if err.Message == "" {
return fmt.Sprintf("json-rpc error %d", err.Code)
}
return err.Message
}

// GetRevertReasonHash returns a solidity contract call revert reason hash.
func GetRevertReasonHash(err error) (string, error) {
bytes, err := json.Marshal(errors.Unwrap(err))
if err != nil {
return "", err
}
rpcError := new(JsonRPCError)
if err = json.Unmarshal(bytes, rpcError); err != nil {
return "", err
}
reasonHash, ok := rpcError.Data.(string)
if !ok {
return "", fmt.Errorf("invalid revert reason, %T", rpcError.Data)
}
return reasonHash, nil
}

// CheckExpectRevertReason checks if the revert reason in solidity contracts matches the expectation.
func CheckExpectRevertReason(expect string, revertErr error) (bool, error) {
reason, err := GetRevertReasonHash(revertErr)
if err != nil {
return false, err
}
return fmt.Sprintf("%#x", crypto.Keccak256([]byte(expect)))[:10] == reason, nil
}
146 changes: 84 additions & 62 deletions bindings/gen_taiko_l1.go

Large diffs are not rendered by default.

37 changes: 14 additions & 23 deletions bindings/gen_taiko_l2.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/rpc/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func SubscribeHeaderSynced(
ch chan *bindings.TaikoL1ClientHeaderSynced,
) event.Subscription {
return SubscribeEvent("HeaderSynced", func(ctx context.Context) (event.Subscription, error) {
sub, err := taikoL1.WatchHeaderSynced(nil, ch, nil, nil)
sub, err := taikoL1.WatchHeaderSynced(nil, ch, nil)
if err != nil {
log.Error("Create TaikoL1.HeaderSynced subscription error", "error", err)
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package version

// Version info.
var (
Version = "0.3.0"
Version = "0.4.0"
Meta = "dev"
)

Expand Down

0 comments on commit 53b9872

Please sign in to comment.