Skip to content

Commit 3f84ea3

Browse files
authored
chore!: bump rust to 1.85.0 and edition to 2024 (#1630)
Closes: #1629 # Breaking Changes - bumped `rust` version to `1.85.0` and edition to `2024`
1 parent ad7be57 commit 3f84ea3

File tree

120 files changed

+432
-339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+432
-339
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919
FUEL_CORE_VERSION: 0.41.7
2020
FUEL_CORE_PATCH_BRANCH: ""
2121
FUEL_CORE_PATCH_REVISION: ""
22-
RUST_VERSION: 1.81.0
22+
RUST_VERSION: 1.85.0
2323
FORC_VERSION: 0.67.0
2424
FORC_PATCH_BRANCH: ""
2525
FORC_PATCH_REVISION: ""

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ members = [
3333

3434
[workspace.package]
3535
authors = ["Fuel Labs <[email protected]>"]
36-
edition = "2021"
36+
edition = "2024"
3737
homepage = "https://fuel.network/"
3838
readme = "README.md"
3939
license = "Apache-2.0"
4040
repository = "https://github.com/FuelLabs/fuels-rs"
41-
rust-version = "1.81.0"
41+
rust-version = "1.85.0"
4242
version = "0.71.0"
4343

4444
[workspace.dependencies]

e2e/src/aws_kms.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use fuels::{
22
accounts::signers::kms::aws::{
3-
aws_config::{defaults, BehaviorVersion, Region},
3+
AwsKmsSigner,
4+
aws_config::{BehaviorVersion, Region, defaults},
45
aws_sdk_kms::{
6+
Client,
57
config::Credentials,
68
types::{KeySpec, KeyUsageType},
7-
Client,
89
},
9-
AwsKmsSigner,
1010
},
1111
prelude::Error,
1212
types::errors::{Context, Result},

e2e/src/e2e_helpers.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::aws_kms::{AwsKms, AwsKmsProcess};
21
use fuels::types::errors::Result;
32

3+
use crate::aws_kms::{AwsKms, AwsKmsProcess};
4+
45
pub async fn start_aws_kms(logs: bool) -> Result<AwsKmsProcess> {
56
AwsKms::default().with_show_logs(logs).start().await
67
}

e2e/tests/aws.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ mod tests {
33
use anyhow::Result;
44
use e2e::e2e_helpers::start_aws_kms;
55
use fuels::{
6-
accounts::{signers::kms::aws::AwsKmsSigner, wallet::Wallet, Account, ViewOnlyAccount},
6+
accounts::{Account, ViewOnlyAccount, signers::kms::aws::AwsKmsSigner, wallet::Wallet},
77
core::traits::Signer,
88
prelude::{
9-
launch_provider_and_get_wallet, AssetId, Contract, LoadConfiguration, TxPolicies,
9+
AssetId, Contract, LoadConfiguration, TxPolicies, launch_provider_and_get_wallet,
1010
},
1111
types::errors::Context,
1212
};

e2e/tests/binary_format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#[cfg(test)]
22
mod tests {
3+
use std::{convert::TryInto, ops::Range};
4+
35
use fuels::programs::executable::{Executable, Regular};
4-
use std::convert::TryInto;
5-
use std::ops::Range;
66

77
const DATA_OFFSET_LOCATION: Range<usize> = 8..16;
88
const CONFIGURABLES_OFFSET_LOCATION: Range<usize> = 16..24;

e2e/tests/configurables.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,10 @@ async fn configurable_encoder_config_is_applied() {
322322
.with_STRUCT(new_struct)
323323
.expect_err("should error");
324324

325-
assert!(configurables_error
326-
.to_string()
327-
.contains("token limit `1` reached while encoding. Try increasing it"),)
325+
assert!(
326+
configurables_error
327+
.to_string()
328+
.contains("token limit `1` reached while encoding. Try increasing it"),
329+
)
328330
}
329331
}

e2e/tests/contracts.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
use std::time::Duration;
22

33
use fuel_tx::{
4-
consensus_parameters::{ConsensusParametersV1, FeeParametersV1},
54
ConsensusParameters, FeeParameters, Output,
5+
consensus_parameters::{ConsensusParametersV1, FeeParametersV1},
66
};
77
use fuels::{
88
accounts::signers::private_key::PrivateKeySigner,
9-
core::codec::{calldata, encode_fn_selector, DecoderConfig, EncoderConfig},
9+
core::codec::{DecoderConfig, EncoderConfig, calldata, encode_fn_selector},
1010
prelude::*,
1111
programs::DEFAULT_MAX_FEE_ESTIMATION_TOLERANCE,
1212
tx::ContractParameters,
13-
types::{errors::transaction::Reason, input::Input, Bits256, Identity},
13+
types::{Bits256, Identity, errors::transaction::Reason, input::Input},
1414
};
1515
use rand::thread_rng;
1616
use tokio::time::Instant;
@@ -699,8 +699,8 @@ async fn test_connect_wallet() -> Result<()> {
699699
Ok(())
700700
}
701701

702-
async fn setup_output_variable_estimation_test(
703-
) -> Result<(Vec<Wallet>, [Identity; 3], AssetId, Bech32ContractId)> {
702+
async fn setup_output_variable_estimation_test()
703+
-> Result<(Vec<Wallet>, [Identity; 3], AssetId, Bech32ContractId)> {
704704
let wallet_config = WalletsConfig::new(Some(3), None, None);
705705
let wallets = launch_custom_provider_and_get_wallets(wallet_config, None, None).await?;
706706

@@ -1353,7 +1353,7 @@ fn db_rocksdb() {
13531353
use fuels::{
13541354
accounts::wallet::Wallet,
13551355
client::{PageDirection, PaginationRequest},
1356-
prelude::{setup_test_provider, DbType, Error, ViewOnlyAccount, DEFAULT_COIN_AMOUNT},
1356+
prelude::{DEFAULT_COIN_AMOUNT, DbType, Error, ViewOnlyAccount, setup_test_provider},
13571357
};
13581358

13591359
let temp_dir = tempfile::tempdir().expect("failed to make tempdir");
@@ -2237,9 +2237,9 @@ async fn blob_contract_deployment() -> Result<()> {
22372237
.len();
22382238

22392239
assert!(
2240-
contract_size > 150_000,
2241-
"the testnet size limit was around 100kB, we want a contract bigger than that to reflect prod (current: {contract_size}B)"
2242-
);
2240+
contract_size > 150_000,
2241+
"the testnet size limit was around 100kB, we want a contract bigger than that to reflect prod (current: {contract_size}B)"
2242+
);
22432243

22442244
let wallets =
22452245
launch_custom_provider_and_get_wallets(WalletsConfig::new(Some(2), None, None), None, None)
@@ -2251,9 +2251,9 @@ async fn blob_contract_deployment() -> Result<()> {
22512251

22522252
let contract_max_size = consensus_parameters.contract_params().contract_max_size();
22532253
assert!(
2254-
contract_size > contract_max_size,
2255-
"this test should ideally be run with a contract bigger than the max contract size ({contract_max_size}B) so that we know deployment couldn't have happened without blobs"
2256-
);
2254+
contract_size > contract_max_size,
2255+
"this test should ideally be run with a contract bigger than the max contract size ({contract_max_size}B) so that we know deployment couldn't have happened without blobs"
2256+
);
22572257

22582258
let contract = Contract::load_from(contract_binary, LoadConfiguration::default())?;
22592259

e2e/tests/debug_utils.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,13 @@ async fn can_debug_multi_call_tx() -> Result<()> {
230230

231231
assert_eq!(
232232
decoder.decode_fn_args(&fn_selector, call_description.encoded_args.as_slice())?,
233-
vec![ "AllStruct { some_struct: SomeStruct { field: 2, field_2: true } }".to_string(), format!("MemoryAddress {{ contract_id: std::contract_id::ContractId {{ bits: Bits256({:?}) }}, function_selector: 123, function_data: 456 }}", contract_id.as_slice())]
233+
vec![
234+
"AllStruct { some_struct: SomeStruct { field: 2, field_2: true } }".to_string(),
235+
format!(
236+
"MemoryAddress {{ contract_id: std::contract_id::ContractId {{ bits: Bits256({:?}) }}, function_selector: 123, function_data: 456 }}",
237+
contract_id.as_slice()
238+
)
239+
]
234240
);
235241
}
236242

@@ -303,8 +309,17 @@ async fn can_debug_multi_call_tx() -> Result<()> {
303309
assert_eq!(call_description.gas_forwarded, Some(25));
304310

305311
assert_eq!(
306-
decoder.decode_fn_args(&call_description.decode_fn_selector().unwrap(), call_description.encoded_args.as_slice())?,
307-
vec![ "AllStruct { some_struct: SomeStruct { field: 2, field_2: true } }".to_string(), format!("MemoryAddress {{ contract_id: std::contract_id::ContractId {{ bits: Bits256({:?}) }}, function_selector: 123, function_data: 456 }}", contract_id.as_slice())]
312+
decoder.decode_fn_args(
313+
&call_description.decode_fn_selector().unwrap(),
314+
call_description.encoded_args.as_slice()
315+
)?,
316+
vec![
317+
"AllStruct { some_struct: SomeStruct { field: 2, field_2: true } }".to_string(),
318+
format!(
319+
"MemoryAddress {{ contract_id: std::contract_id::ContractId {{ bits: Bits256({:?}) }}, function_selector: 123, function_data: 456 }}",
320+
contract_id.as_slice()
321+
)
322+
]
308323
);
309324
}
310325

e2e/tests/logs.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use fuels::{
22
core::codec::DecoderConfig,
33
prelude::*,
4-
types::{errors::transaction::Reason, AsciiString, Bits256, SizedAsciiString},
4+
types::{AsciiString, Bits256, SizedAsciiString, errors::transaction::Reason},
55
};
66

77
#[tokio::test]
@@ -1634,7 +1634,10 @@ async fn can_configure_decoder_for_contract_log_decoding() -> Result<()> {
16341634
);
16351635

16361636
let logs = response.decode_logs();
1637-
assert!(!logs.filter_failed().is_empty(), "Should have had failed to decode logs since there are more tokens than what is supported by default");
1637+
assert!(
1638+
!logs.filter_failed().is_empty(),
1639+
"Should have had failed to decode logs since there are more tokens than what is supported by default"
1640+
);
16381641
}
16391642
{
16401643
// Single call: increasing limits makes the test pass
@@ -1669,7 +1672,10 @@ async fn can_configure_decoder_for_contract_log_decoding() -> Result<()> {
16691672
);
16701673

16711674
let logs = response.decode_logs();
1672-
assert!(!logs.filter_failed().is_empty(), "should have had failed to decode logs since there are more tokens than what is supported by default");
1675+
assert!(
1676+
!logs.filter_failed().is_empty(),
1677+
"should have had failed to decode logs since there are more tokens than what is supported by default"
1678+
);
16731679
}
16741680
{
16751681
// Multi call: increasing limits makes the test pass

0 commit comments

Comments
 (0)