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

fix: tests in kona-mpt #738

Merged
merged 1 commit into from
Oct 28, 2024
Merged

fix: tests in kona-mpt #738

merged 1 commit into from
Oct 28, 2024

Conversation

steph-rs
Copy link
Contributor

This PR resolves compilation issues in the kona-mpt crate by adding reqwest feature, and other small fixes

Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.8%. Comparing base (938805a) to head (a5f7082).
Report is 1 commits behind head on main.

Additional details and impacted files

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@steph-rs
Copy link
Contributor Author

hi, this is my first PR here, so please let me know if anything is wrong 🙏
also, you might want to think about running CI only after approval. just a suggestion!

@refcell
Copy link
Collaborator

refcell commented Oct 27, 2024

Unsure as to where there are compilation errors. Do you have a command I can reproduce that causes the kona-mpt build to break?

@steph-rs
Copy link
Contributor Author

steph-rs commented Oct 27, 2024

hey @refcell
I just wanted to check benches in mpt crate, and I met some compilation errors in test config.

cd crates/mpt
cargo bench # or test

full log:

crates/mpt  cargo bench                                                                                               6.6s  Sun Oct 27 16:16:07 2024
   Compiling kona-mpt v0.0.4 (kona/crates/mpt)
error[E0599]: no method named `on_http` found for struct `ProviderBuilder` in the current scope
  --> crates/mpt/src/test_util.rs:18:43
   |
18 |     let provider = ProviderBuilder::new().on_http(Url::parse(RPC_URL).expect("invalid rpc url"));
   |                                           ^^^^^^^ method not found in `ProviderBuilder<Identity, Identity>`

error[E0282]: type annotations needed
  --> crates/mpt/src/test_util.rs:24:19
   |
24 |         .map_err(|e| anyhow!(e))?
   |                   ^  ---------- type must be known at this point
   |
help: consider giving this closure parameter an explicit type
   |
24 |         .map_err(|e: /* Type */| anyhow!(e))?
   |                    ++++++++++++

error[E0282]: type annotations needed
  --> crates/mpt/src/test_util.rs:29:19
   |
29 |         .map_err(|e| anyhow!(e))?
   |                   ^  ---------- type must be known at this point
   |
help: consider giving this closure parameter an explicit type
   |
29 |         .map_err(|e: /* Type */| anyhow!(e))?
   |                    ++++++++++++

error[E0282]: type annotations needed for `&_`
  --> crates/mpt/src/test_util.rs:62:65
   |
62 |         ordered_trie_with_encoder(consensus_receipts.as_ref(), |rlp, buf| rlp.encode_2718(buf));
   |                                                                 ^^^           ----------- type must be known at this point
   |
help: consider giving this closure parameter an explicit type, where the type for type parameter `T` is specified
   |
62 |         ordered_trie_with_encoder(consensus_receipts.as_ref(), |rlp: &T, buf| rlp.encode_2718(buf));
   |                                                                    ++++

error[E0599]: no method named `on_http` found for struct `ProviderBuilder` in the current scope
  --> crates/mpt/src/test_util.rs:84:43
   |
84 |     let provider = ProviderBuilder::new().on_http(Url::parse(RPC_URL).expect("invalid rpc url"));
   |                                           ^^^^^^^ method not found in `ProviderBuilder<Identity, Identity>`

error[E0282]: type annotations needed
  --> crates/mpt/src/test_util.rs:90:19
   |
90 |         .map_err(|e| anyhow!(e))?
   |                   ^  ---------- type must be known at this point
   |
help: consider giving this closure parameter an explicit type
   |
90 |         .map_err(|e: /* Type */| anyhow!(e))?
   |                    ++++++++++++

error[E0282]: type annotations needed
  --> crates/mpt/src/test_util.rs:98:53
   |
98 |         .map(|tx| TxEnvelope::try_from(tx).map_err(|e| anyhow!(e)))
   |                                                     ^  ---------- type must be known at this point
   |
help: consider giving this closure parameter an explicit type
   |
98 |         .map(|tx| TxEnvelope::try_from(tx).map_err(|e: /* Type */| anyhow!(e)))
   |                                                      ++++++++++++

error[E0282]: type annotations needed for `&_`
   --> crates/mpt/src/test_util.rs:103:60
    |
103 |         ordered_trie_with_encoder(consensus_txs.as_ref(), |rlp, buf| rlp.encode_2718(buf));
    |                                                            ^^^           ----------- type must be known at this point
    |
help: consider giving this closure parameter an explicit type, where the type for type parameter `T` is specified
    |
103 |         ordered_trie_with_encoder(consensus_txs.as_ref(), |rlp: &T, buf| rlp.encode_2718(buf));
    |                                                               ++++

warning: unused import: `network::eip2718::Encodable2718`
 --> crates/mpt/src/test_util.rs:7:22
  |
7 | use alloy_provider::{network::eip2718::Encodable2718, Provider, ProviderBuilder};
  |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `Provider`
 --> crates/mpt/src/test_util.rs:7:55
  |
7 | use alloy_provider::{network::eip2718::Encodable2718, Provider, ProviderBuilder};
  |                                                       ^^^^^^^^

Some errors have detailed explanations: E0282, E0599.
For more information about an error, try `rustc --explain E0282`.
warning: `kona-mpt` (lib test) generated 2 warnings
error: could not compile `kona-mpt` (lib test) due to 8 previous errors; 2 warnings emitted

@refcell
Copy link
Collaborator

refcell commented Oct 28, 2024

Thanks @steph-rs for clarifying, I'm seeing the same issue for benches.

Copy link
Collaborator

@refcell refcell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@refcell refcell added this pull request to the merge queue Oct 28, 2024
Merged via the queue into anton-rs:main with commit e230e20 Oct 28, 2024
17 checks passed
@github-actions github-actions bot mentioned this pull request Oct 25, 2024
@steph-rs steph-rs deleted the fix/mpt-tests branch October 28, 2024 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants