Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(base_layer): start migrating ethers->alloy #848

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Commits on Sep 18, 2024

  1. feat(base_layer): start migrating ethers->alloy

    Minimal logic changes, strictly migration.
    Refactors of existing code are added on a separate commit on top
    of this one, to separate the migration from the refactor.
    
    *Notable changes*
    
    - Errors:
     * `ProviderError` on `ethers` was only the node_url parse error, which
     isn't needed for `on_http` since it already expects a `Url` argument.
     * `AbiError` and `BadContract` type errors are both sub-variants of
       the `Contract` variant, that is, both errors types are variants
       of `alloy_contract::Error`.
    
    - API:
      * Return type of the call API now only implements `IntoFuture`,
      rather than `Future` like on `ethers`, hence manually calling
      `into_future()` is required before passing it to `tokio`.
      * `call()` in alloy returns a dynamic type, which is alloy
      [discourages](https://docs.rs/alloy-dyn-abi/latest/alloy_dyn_abi/)
      when types are known at compilation-time. Therefore using `call_raw`,
      which returns `Bytes`, and casting statically.
    
    commit-id:b8b28c1a
    Gilad Chase committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    e8546e9 View commit details
    Browse the repository at this point in the history