Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades the Rust crate from edition 2021 to edition 2024. The workspace configuration uses a centralized edition setting that is automatically inherited by both workspace members (api and types crates) via edition.workspace = true. The minimum Rust version is set to 1.85, which supports edition 2024.
Changes:
- Updated workspace edition from "2021" to "2024" in the root Cargo.toml
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #118 +/- ##
==========================================
- Coverage 51.58% 51.58% -0.01%
==========================================
Files 40 40
Lines 5168 5172 +4
==========================================
+ Hits 2666 2668 +2
- Misses 2502 2504 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
88fc803 to
bd19016
Compare
api/examples/specifying_block.rs
Outdated
| // Fetch a single final block | ||
| let final_block = Chain::block() | ||
| .at(Reference::Final) | ||
| .fetch_from_mainnet() | ||
| .await?; | ||
|
|
||
| let block_number = Chain::block_number().fetch_from_mainnet().await?; | ||
| let block_hash = Chain::block_hash().fetch_from_mainnet().await?; | ||
| let block_number = final_block.header.height; | ||
| let block_hash = final_block.header.hash.into(); | ||
|
|
||
| let _block = Chain::block() | ||
| let _block_by_number = Chain::block() |
There was a problem hiding this comment.
I think the purpose of this test is to test code path of retrieving specific information of the block (block itself, "block_hash", "block_number"), right @akorchyn?
AFAIU, @r-near changed this test due to it failing to find block. It is related to the block reference being optimistic in Chain::block_number() and Chain::block_hash(), right?
Maybe we should just change these lines in test then:
// Fetch a single final block
let _final_block = Chain::block()
.at(Reference::Optimistic)
.fetch_from_mainnet()
.await?;
let block_number = Chain::block_number()
.at(Reference::Final)
.fetch_from_mainnet()
.await?;
let block_hash = Chain::block_hash()
.at(Reference::Final)
.fetch_from_mainnet()
.await?;8330eff to
1c82c83
Compare
1c82c83 to
2793c9e
Compare
Updates the crate to Rust edition 2024 with resolver v3.