Skip to content

Commit

Permalink
feat(base_layer): start migrating ethers->alloy
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Gilad Chase committed Sep 18, 2024
1 parent a4b398f commit 35a0d49
Show file tree
Hide file tree
Showing 5 changed files with 1,047 additions and 139 deletions.
Loading

0 comments on commit 35a0d49

Please sign in to comment.