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

chore: upgrade Rust toolchain to 1.85.0 and language edition to 2024 #147

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
run:
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- run: wasm-pack --version

- uses: sigoden/install-binary@v1
with:
repo: WebAssembly/binaryen
Expand Down
16 changes: 11 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
[package]
name = "forest-explorer"
version = "0.1.0"
edition = "2021"
edition = "2024"
authors = ["Forest Team <forest@chainsafe.io>"]

[lib]
crate-type = ["cdylib"]

[workspace]
members = ["e2e"]
resolver = "2"

[dependencies]
anyhow = "1"
Expand Down
4 changes: 1 addition & 3 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ feature-depth = 1
#db-urls = ["https://github.com/rustsec/advisory-db"]
# A list of advisory IDs to ignore. Note that ignored advisories will still
# output a note when they are encountered.
ignore = [
"RUSTSEC-2024-0370", # proc-macro-error is unmaintained
]
ignore = []
# If this is true, then cargo deny will use the git executable to fetch advisory database.
# If this is false, then it uses a built-in git library.
# Setting this to true can be helpful if you have special authentication requirements that cargo-deny does not support.
Expand Down
2 changes: 1 addition & 1 deletion e2e/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "e2e"
version = "0.1.0"
edition = "2021"
edition = "2024"

[dependencies]
thirtyfour = "0.35"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"node": ">=18.0.0"
},
"devDependencies": {
"prettier": "^3.4.2",
"prettier": "^3.5.2",
"tailwindcss": "^3.4.17",
"wrangler": "^3.100.0"
},
Expand All @@ -21,5 +21,5 @@
"dev": "wrangler dev --env quick",
"start": "wrangler dev"
},
"packageManager": "yarn@4.5.3"
"packageManager": "yarn@4.6.0"
}
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.83.0"
channel = "1.85.0"
components = ["clippy", "rustfmt"]
targets = ["wasm32-unknown-unknown"]
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
edition = "2021"
edition = "2024"
2 changes: 1 addition & 1 deletion src/address.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::ensure;
use fvm_shared::address::{Address, Network};
use fvm_shared::ActorID;
use fvm_shared::address::{Address, Network};

// '0x' + 20bytes
const ETH_ADDRESS_LENGTH: usize = 42;
Expand Down
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::rpc_context::RpcContext;
use leptos::prelude::*;
use leptos::{component, leptos_dom::helpers::event_target_value, view, IntoView};
use leptos::{IntoView, component, leptos_dom::helpers::event_target_value, view};
use leptos_meta::*;
use leptos_router::components::*;
use leptos_router::path;
Expand Down
2 changes: 1 addition & 1 deletion src/faucet/utils.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[cfg(feature = "ssr")]
use crate::key::{sign, Key};
use crate::key::{Key, sign};
use crate::{lotus_json::LotusJson, message::SignedMessage};
#[cfg(feature = "ssr")]
use fvm_shared::address::Network;
Expand Down
2 changes: 1 addition & 1 deletion src/faucet/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::time::Duration;

use fvm_shared::address::Network;
use leptos::task::spawn_local;
use leptos::{component, leptos_dom::helpers::event_target_value, view, IntoView};
use leptos::{IntoView, component, leptos_dom::helpers::event_target_value, view};

use leptos::prelude::*;
use leptos_meta::{Meta, Title};
Expand Down
3 changes: 1 addition & 2 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ pub fn new_address(sig_type: SignatureType, public_key: &[u8]) -> Result<Address
}

pub mod base64_standard {
use base64::engine::{Engine as _, general_purpose::STANDARD};
use serde::{Deserialize, Deserializer, Serialize, Serializer};

use base64::engine::{general_purpose::STANDARD, Engine as _};

pub fn serialize<S>(value: &[u8], serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ mod ssr_imports {
use std::sync::Arc;

use crate::{
app::{shell, App},
app::{App, shell},
faucet,
};
use axum::{routing::post, Extension, Router};
use axum::{Extension, Router, routing::post};
use leptos::prelude::*;
use leptos_axum::{generate_route_list, LeptosRoutes};
use worker::{event, Context, Env, HttpRequest, Result};
use leptos_axum::{LeptosRoutes, generate_route_list};
use worker::{Context, Env, HttpRequest, Result, event};

fn router(env: Env) -> Router {
let leptos_options = LeptosOptions::builder()
Expand Down
6 changes: 3 additions & 3 deletions src/lotus_json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@

use ::cid::Cid;
use derive_more::From;
use serde::{de::DeserializeOwned, Deserialize, Deserializer, Serialize, Serializer};
use serde::{Deserialize, Deserializer, Serialize, Serializer, de::DeserializeOwned};
use std::{fmt::Display, str::FromStr};

pub trait HasLotusJson: Sized {
Expand Down Expand Up @@ -177,7 +177,7 @@ mod vec_u8;
// mod nonempty; // can't make snapshots of generic type
// mod opt; // can't make snapshots of generic type
mod raw_bytes; // fvm_ipld_encoding::RawBytes: !quickcheck::Arbitrary
// mod vec; // can't make snapshots of generic type
// mod vec; // can't make snapshots of generic type

// pub use vec::*;

Expand Down Expand Up @@ -307,7 +307,7 @@ pub mod stringify {
pub mod base64_standard {
use super::*;

use base64::engine::{general_purpose::STANDARD, Engine as _};
use base64::engine::{Engine as _, general_purpose::STANDARD};

pub fn serialize<S>(value: &[u8], serializer: S) -> Result<S::Ok, S::Error>
where
Expand Down
2 changes: 1 addition & 1 deletion src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use fvm_ipld_encoding::Error;
use fvm_ipld_encoding::RawBytes;
pub use fvm_shared::message::Message;
use fvm_shared::{
METHOD_SEND,
address::Address,
crypto::signature::{Signature, SignatureType},
econ::TokenAmount,
METHOD_SEND,
};
use multihash_codetable::{Code, MultihashDigest as _};
use serde::{Deserialize, Serialize};
Expand Down
4 changes: 2 additions & 2 deletions src/rpc_context.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use cid::Cid;
use fvm_shared::address::{set_current_network, Address, Network};
use fvm_shared::address::{Address, Network, set_current_network};
use fvm_shared::econ::TokenAmount;
use fvm_shared::message::Message;
use leptos::prelude::*;
use reqwest::Client;
use serde_json::{json, Value};
use serde_json::{Value, json};
use std::sync::LazyLock;

use crate::lotus_json::{HasLotusJson, LotusJson};
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1634,12 +1634,12 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:^3.4.2":
version: 3.4.2
resolution: "prettier@npm:3.4.2"
"prettier@npm:^3.5.2":
version: 3.5.2
resolution: "prettier@npm:3.5.2"
bin:
prettier: bin/prettier.cjs
checksum: 10c0/99e076a26ed0aba4ebc043880d0f08bbb8c59a4c6641cdee6cdadf2205bdd87aa1d7823f50c3aea41e015e99878d37c58d7b5f0e663bba0ef047f94e36b96446
checksum: 10c0/d7b597ed33f39c32ace675896ad187f06a3e48dc8a1e80051b5c5f0dae3586d53981704b8fda5ac3b080e6c2e0e197d239131b953702674f044351621ca5e1ac
languageName: node
linkType: hard

Expand Down Expand Up @@ -1783,7 +1783,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "root@workspace:."
dependencies:
prettier: "npm:^3.4.2"
prettier: "npm:^3.5.2"
tailwindcss: "npm:^3.4.17"
wrangler: "npm:^3.100.0"
languageName: unknown
Expand Down
Loading