-
Notifications
You must be signed in to change notification settings - Fork 25
feat: add Optimism as separate N-API package #659
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
base: main
Are you sure you want to change the base?
Conversation
|
scenarios = ["rand"] | ||
|
||
[profile.release] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo
was reporting that this setting was ignored. Only the workspace Cargo.toml
's profile are respected.
@@ -4,17 +4,15 @@ version = "0.3.5" | |||
edition = "2021" | |||
|
|||
[lib] | |||
crate-type = ["cdylib"] | |||
crate-type = ["cdylib", "lib"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is required for edr_napi_optimism
to use this crate as a dependency
@@ -0,0 +1,1193 @@ | |||
use core::fmt::Debug; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File moved from edr_napi
, with a modification to the config. This removes the dependency on napi
types.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/multichain #659 +/- ##
==================================================
Coverage ? 63.07%
==================================================
Files ? 216
Lines ? 23689
Branches ? 23689
==================================================
Hits ? 14941
Misses ? 7819
Partials ? 929 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -10,7 +10,6 @@ on: | |||
workflow_dispatch: | |||
|
|||
env: | |||
RUSTFLAGS: -Dwarnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not have any adverse side-effects, as we also manually pass this argument to cargo clippy
which should fail if there are any warnings.
For reference:
cargo clippy --workspace --all-targets --all-features -- -D warnings
5c5aac5
to
bb89e37
Compare
bb89e37
to
fb093cf
Compare
This PR restructures the
edr_napi_core
andedr_napi
to be able to share code with the newedr_napi_optimism
package.I ran into one problem that I was able to solve. Namely, when a crate that generates NAPI bindings is added as a dependency to another crate that generates NAPI bindings, the test target of the dependant crate will throw linker errors. This is a known issue. I was only able to work around it by adding the recommended rustflags to both the workspace- and project-level
.cargo/config.toml
. If I only added it to the project, thecargo test --all-features --all-targets --workspace
command would still throw the linker errors.There is currently still a bug in the
edr_napi_optimism
JS tests. In the background, thehyper
Client is sporadically trying to execute a future using its executor. By default, this executor usestokio::spawn
but since theedr_optimism
NPM package doesn't have a tokio runtime, this panics.The solution is to specify a custom executor, but reqwest always uses the Tokio executor. An issue exists to add this executor, but a previous PR was rejected because it was deemed unnecessary.
For now, my proposal would be to merge the changes to the project layout and move forward with the release of the
GenericChainSpec
, asedr_optimism
won't be exposed anyway.A future issue can then:
reqwest
tokio::Runtime
of ouredr
NPM package's runtimeCould you please pay special attention to these two aspects when reviewing?