Skip to content

Commit 5e64e20

Browse files
authored
feat: update rust to 1.93 and improve code structure with new lints (#109)
1 parent 19c1a89 commit 5e64e20

File tree

29 files changed

+523
-302
lines changed

29 files changed

+523
-302
lines changed

Cargo.lock

Lines changed: 451 additions & 258 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version = "0.1.0"
33
authors = ["Aurora Labs <hello@aurora.dev>"]
44
edition = "2024"
5-
rust-version = "1.86.0"
5+
rust-version = "1.93.0"
66
homepage = "https://github.com/aurora-is-near/aurora-cli-rs"
77
repository = "https://github.com/aurora-is-near/aurora-cli-rs"
88
readme = "README.md"
@@ -14,6 +14,14 @@ members = [
1414
"sdk"
1515
]
1616

17+
[workspace.lints.clippy]
18+
all = { level = "deny", priority = -1 }
19+
pedantic = { level = "deny", priority = -1 }
20+
nursery = { level = "deny", priority = -1 }
21+
missing_errors_doc = "allow"
22+
missing_panics_doc = "allow"
23+
result_large_err = "allow" # TODO: Remove this when we have better error types in place
24+
1725
[workspace.dependencies]
1826
anyhow = "1"
1927
aurora-engine-precompiles = { version = "2", features = ["std"] }
@@ -45,4 +53,4 @@ serde_json = "1"
4553
shadow-rs = "1"
4654
thiserror = "2"
4755
tokio = { version = "1", features = ["full"] }
48-
toml = "0.9"
56+
toml = "1"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
<br />
1111

1212
[![CI](https://github.com/aurora-is-near/aurora-cli-rs/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/aurora-is-near/aurora-cli-rs/actions/workflows/rust.yml)
13-
![rust 1.70.0+ required](https://img.shields.io/badge/rust-1.70.0+-blue.svg?label=MSRV)
13+
![rust 1.93.0+ required](https://img.shields.io/badge/rust-1.93.0+-blue.svg?label=MSRV)
1414

1515
## What is Engine?
1616

1717
[Aurora](https://doc.aurora.dev/getting-started/aurora-engine/) is an Ethereum Virtual Machine (EVM)
18-
project built on the NEAR Protocol, that provides a solution for developers to deploy their apps
19-
on an Ethereum-compatible, high-throughput, scalable and future-safe platform, with low transaction costs
18+
project built on the NEAR Protocol that provides a solution for developers to deploy their apps
19+
on an Ethereum-compatible, high-throughput, scalable, and future-safe platform, with low transaction costs
2020
for their users. Engine is the Aurora's implementation for it.
2121

2222
## What is Aurora CLI?
@@ -51,7 +51,7 @@ smart contract and will be interacting with it.
5151

5252
### **Requirements**
5353

54-
- Rust 1.75.0 or newer
54+
- Rust 1.93.0 or newer
5555
- Python3
5656

5757
First what we need to do is to install `aurora-cli`:

cli/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ path = "src/lib.rs"
1717
name = "aurora-cli"
1818
path = "src/main.rs"
1919

20+
[lints]
21+
workspace = true
22+
2023
[features]
2124
default = ["simple"]
2225
simple = ["toml"]

cli/src/cli/advanced/aurora.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ use aurora_engine_types::types::Address;
33
use aurora_engine_types::{U256, types::Wei};
44
use clap::Subcommand;
55

6-
use crate::{client::AuroraClient, config::Config, utils};
6+
use crate::cli::advanced::Config;
7+
use crate::{client::AuroraClient, utils};
78

89
#[derive(Subcommand)]
910
pub enum Command {
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use serde::{Deserialize, Serialize};
2-
#[cfg(feature = "advanced")]
32
use std::path::Path;
43

54
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@@ -11,7 +10,6 @@ pub struct Config {
1110
pub evm_secret_key: Option<String>,
1211
}
1312

14-
#[cfg(feature = "advanced")]
1513
impl Config {
1614
pub fn from_file<P: AsRef<Path>>(path: P) -> anyhow::Result<Self> {
1715
std::fs::File::open(path)

cli/src/cli/advanced/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
use clap::{Parser, Subcommand};
22

3-
use crate::config::{Config, Network};
3+
use crate::cli::advanced::config::{Config, Network};
44

55
pub mod aurora;
6+
pub mod config;
67
pub mod erc20;
78
pub mod near;
89
pub mod process_tx_data;

cli/src/cli/advanced/near.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
use crate::{
2-
config::{Config, Network},
3-
utils,
4-
};
51
use aurora_engine_types::borsh::BorshDeserialize;
62
use aurora_engine_types::parameters::connector::PauseEthConnectorArgs;
73
use aurora_engine_types::parameters::engine::{
@@ -24,6 +20,9 @@ use near_primitives::{
2420
};
2521
use std::{path::Path, str::FromStr};
2622

23+
use crate::cli::advanced::{Config, Network};
24+
use crate::utils;
25+
2726
/// Chain ID for Aurora localnet, per the documentation on
2827
/// <https://doc.aurora.dev/getting-started/network-endpoints>
2928
#[allow(clippy::unreadable_literal)]
@@ -252,6 +251,7 @@ pub enum InitCommand {
252251
},
253252
}
254253

254+
#[allow(clippy::too_many_lines)]
255255
pub async fn execute_command(
256256
command: Command,
257257
client: &NearClient,
@@ -638,7 +638,7 @@ pub async fn execute_command(
638638
key_file
639639
.write_to_file(&key_path)
640640
.expect("Failed to write Aurora access key file");
641-
println!("Aurora access key written to {key_path:?}");
641+
println!("Aurora access key written to {}", key_path.display());
642642
}
643643
InitCommand::LocalConfig {
644644
nearcore_config_path,

cli/src/cli/advanced/solidity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl Solidity {
8787
}
8888
}
8989

90-
fn read_arg(arg: Option<&str>, stdin_arg: Option<bool>) -> Cow<str> {
90+
fn read_arg(arg: Option<&str>, stdin_arg: Option<bool>) -> Cow<'_, str> {
9191
arg.map_or_else(
9292
|| match stdin_arg {
9393
Some(true) => {

cli/src/cli/simple/command/silo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl Display for FixedGas {
205205
let value = self
206206
.0
207207
.fixed_gas
208-
.map_or("none".to_string(), |cost| cost.to_string());
208+
.map_or_else(|| "none".to_string(), |cost| cost.to_string());
209209
f.write_str(&value)
210210
}
211211
}

0 commit comments

Comments
 (0)