Skip to content

Commit 1ac3514

Browse files
Dentosalzees-devJoshuaBattyIGI-111
authored
Bump fuel deps (#7228)
## Description Bumps fuel-vm, fuel-core fuels-rs and forc-wallet to latest versions. Upgrades Rust to 2021 edition. ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [x] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - I believe this is non-breaking from user code perspective but I'm not too sure about that - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: z <zees-dev@users.noreply.github.com> Co-authored-by: zees-dev <63374656+zees-dev@users.noreply.github.com> Co-authored-by: JoshuaBatty <joshpbatty@gmail.com> Co-authored-by: IGI-111 <igi-111@protonmail.com>
1 parent e054b39 commit 1ac3514

File tree

47 files changed

+1736
-1949
lines changed

Some content is hidden

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

47 files changed

+1736
-1949
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,24 @@ fuel-abi-types = "0.12"
8989
# Although ALL versions are "X.Y", we need the complete semver for
9090
# fuel-core-client as the GitHub Actions workflow parses this value to pull down
9191
# the correct tarball.
92-
fuel-core-client = { version = "0.43.2", default-features = false }
93-
fuel-core-types = { version = "0.43", default-features = false }
92+
fuel-core-client = { version = "0.44.0", default-features = false }
93+
fuel-core-types = { version = "0.44", default-features = false }
9494

9595
# Dependencies from the `fuels-rs` repository:
9696

97-
fuels = "0.73"
98-
fuels-core = "0.73"
99-
fuels-accounts = "0.73"
97+
fuels = "0.74"
98+
fuels-core = "0.74"
99+
fuels-accounts = "0.74"
100100

101101
# Dependencies from the `fuel-vm` repository:
102-
fuel-asm = "0.60"
103-
fuel-crypto = "0.60"
104-
fuel-types = "0.60"
105-
fuel-tx = "0.60"
106-
fuel-vm = "0.60"
102+
fuel-asm = "0.62"
103+
fuel-crypto = "0.62"
104+
fuel-types = "0.62"
105+
fuel-tx = "0.62"
106+
fuel-vm = "0.62"
107107

108108
# Dependencies from the `forc-wallet` repository:
109-
forc-wallet = "0.14"
109+
forc-wallet = "0.15"
110110

111111
#
112112
# External dependencies

forc-pkg/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ homepage.workspace = true
88
license.workspace = true
99
repository.workspace = true
1010

11+
[target.'cfg(not(target_os = "macos"))'.dependencies]
12+
sysinfo.workspace = true
13+
1114
[dependencies]
1215
ansiterm.workspace = true
1316
anyhow.workspace = true
@@ -47,6 +50,3 @@ walkdir.workspace = true
4750
[dev-dependencies]
4851
regex.workspace = true
4952
tempfile.workspace = true
50-
51-
[target.'cfg(not(target_os = "macos"))'.dependencies]
52-
sysinfo.workspace = true

forc-plugins/forc-client/Cargo.toml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@ homepage.workspace = true
88
license.workspace = true
99
repository.workspace = true
1010

11+
[lib]
12+
path = "src/lib.rs"
13+
14+
[[bin]]
15+
name = "forc-deploy"
16+
path = "src/bin/deploy.rs"
17+
18+
[[bin]]
19+
name = "forc-run"
20+
path = "src/bin/run.rs"
21+
22+
[[bin]]
23+
name = "forc-submit"
24+
path = "src/bin/submit.rs"
25+
26+
[[bin]]
27+
name = "forc-call"
28+
path = "src/bin/call.rs"
29+
1130
[dependencies]
1231
ansiterm.workspace = true
1332
anyhow.workspace = true
@@ -59,29 +78,10 @@ toml_edit.workspace = true
5978
tracing.workspace = true
6079
url.workspace = true
6180

81+
[build-dependencies]
82+
regex.workspace = true
83+
6284
[dev-dependencies]
6385
portpicker.workspace = true
6486
pretty_assertions.workspace = true
6587
rexpect.workspace = true
66-
67-
[build-dependencies]
68-
regex.workspace = true
69-
70-
[[bin]]
71-
name = "forc-deploy"
72-
path = "src/bin/deploy.rs"
73-
74-
[[bin]]
75-
name = "forc-run"
76-
path = "src/bin/run.rs"
77-
78-
[[bin]]
79-
name = "forc-submit"
80-
path = "src/bin/submit.rs"
81-
82-
[[bin]]
83-
name = "forc-call"
84-
path = "src/bin/call.rs"
85-
86-
[lib]
87-
path = "src/lib.rs"

forc-plugins/forc-client/src/cmd/call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl Command {
346346
return Err("Direct transfers are only supported in live mode".to_string());
347347
}
348348
return Ok(Operation::DirectTransfer {
349-
recipient: (*self.address).into(),
349+
recipient: self.address,
350350
amount: self.call_parameters.amount,
351351
asset_id: self.call_parameters.asset_id,
352352
});

forc-plugins/forc-client/src/op/call/call_function.rs

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use fuels_core::{
2323
EncoderConfig, ErrorDetails, LogDecoder,
2424
},
2525
types::{
26-
bech32::Bech32ContractId,
2726
param_types::ParamType,
2827
transaction::Transaction,
2928
transaction_builders::{BuildableTransaction, ScriptBuildStrategy, VariableOutputPolicy},
@@ -70,7 +69,7 @@ pub async fn call_function(
7069

7170
// Create the contract call
7271
let call = ContractCall {
73-
contract_id: contract_id.into(),
72+
contract_id,
7473
encoded_selector: encode_fn_selector(&selector),
7574
encoded_args: Ok(encoded_data),
7675
call_parameters: call_parameters.clone().into(),
@@ -110,10 +109,7 @@ pub async fn call_function(
110109

111110
// Get external contracts (either provided or auto-detected)
112111
let external_contracts = match external_contracts {
113-
Some(external_contracts) => external_contracts
114-
.iter()
115-
.map(|addr| Bech32ContractId::from(*addr))
116-
.collect(),
112+
Some(external_contracts) => external_contracts,
117113
None => {
118114
// Automatically retrieve missing contract addresses from the call
119115
let external_contracts = determine_missing_contracts(
@@ -130,7 +126,7 @@ pub async fn call_function(
130126
"Automatically provided external contract addresses with call (max 10):",
131127
);
132128
external_contracts.iter().for_each(|addr| {
133-
forc_tracing::println_warning(&format!("- 0x{}", ContractId::from(addr)));
129+
forc_tracing::println_warning(&format!("- 0x{}", addr));
134130
});
135131
}
136132
external_contracts
@@ -175,7 +171,7 @@ pub async fn call_function(
175171
cmd::call::ExecutionMode::Live => {
176172
forc_tracing::println_action_green(
177173
"Sending transaction with wallet",
178-
&format!("0x{}", wallet.address().hash()),
174+
&format!("0x{}", wallet.address()),
179175
);
180176
let tx = call
181177
.build_tx(tb, &wallet)
@@ -242,7 +238,7 @@ pub async fn call_function(
242238
}
243239
cmd::call::OutputFormat::Raw => {
244240
let token = receipt_parser
245-
.parse_call(&Bech32ContractId::from(contract_id), &output_param)
241+
.parse_call(contract_id, &output_param)
246242
.map_err(|e| anyhow!("Failed to parse call data: {e}"))?;
247243
token_to_string(&token)
248244
.map_err(|e| anyhow!("Failed to convert token to string: {e}"))?
@@ -386,9 +382,9 @@ pub mod tests {
386382
.unwrap()
387383
.contract_id;
388384

389-
let instance = TestContract::new(id.clone(), wallet.clone());
385+
let instance = TestContract::new(id, wallet.clone());
390386

391-
(instance, id.into(), provider, secret_key)
387+
(instance, id, provider, secret_key)
392388
}
393389

394390
#[tokio::test]
@@ -775,15 +771,15 @@ pub mod tests {
775771

776772
let consensus_parameters = provider.consensus_parameters().await.unwrap();
777773
let base_asset_id = consensus_parameters.base_asset_id();
778-
let get_recipient_balance = |addr: Bech32Address, provider: Provider| async move {
774+
let get_recipient_balance = |addr: Address, provider: Provider| async move {
779775
provider
780-
.get_asset_balance(&addr, *base_asset_id)
776+
.get_asset_balance(&addr, base_asset_id)
781777
.await
782778
.unwrap()
783779
};
784780
let get_contract_balance = |id: ContractId, provider: Provider| async move {
785781
provider
786-
.get_contract_asset_balance(&Bech32ContractId::from(id), *base_asset_id)
782+
.get_contract_asset_balance(&id, base_asset_id)
787783
.await
788784
.unwrap()
789785
};
@@ -828,7 +824,7 @@ pub mod tests {
828824
let (amount, asset_id, recipient) = (
829825
"2",
830826
&format!("{{0x{}}}", base_asset_id),
831-
&format!("(Address:{{0x{}}})", random_wallet.address().hash()),
827+
&format!("(Address:{{0x{}}})", random_wallet.address()),
832828
);
833829
let mut cmd = get_contract_call_cmd(
834830
id,
@@ -846,7 +842,7 @@ pub mod tests {
846842
let operation = cmd.validate_and_get_operation().unwrap();
847843
assert_eq!(call(operation, cmd).await.unwrap().result.unwrap(), "()");
848844
assert_eq!(
849-
get_recipient_balance(random_wallet.address().clone(), provider.clone()).await,
845+
get_recipient_balance(random_wallet.address(), provider.clone()).await,
850846
2
851847
);
852848
assert_eq!(get_contract_balance(id, provider.clone()).await, 1);
@@ -858,7 +854,7 @@ pub mod tests {
858854
let (amount, asset_id, recipient) = (
859855
"5",
860856
&format!("{{0x{}}}", base_asset_id),
861-
&format!("(Address:{{0x{}}})", random_wallet.address().hash()),
857+
&format!("(Address:{{0x{}}})", random_wallet.address()),
862858
);
863859
let mut cmd = get_contract_call_cmd(
864860
id,
@@ -887,7 +883,7 @@ pub mod tests {
887883
let (amount, asset_id, recipient) = (
888884
"3",
889885
&format!("{{0x{}}}", base_asset_id),
890-
&format!("(Address:{{0x{}}})", random_wallet.address().hash()),
886+
&format!("(Address:{{0x{}}})", random_wallet.address()),
891887
);
892888
let mut cmd = get_contract_call_cmd(
893889
id,
@@ -905,7 +901,7 @@ pub mod tests {
905901
let operation = cmd.validate_and_get_operation().unwrap();
906902
assert_eq!(call(operation, cmd).await.unwrap().result.unwrap(), "()");
907903
assert_eq!(
908-
get_recipient_balance(random_wallet.address().clone(), provider.clone()).await,
904+
get_recipient_balance(random_wallet.address(), provider.clone()).await,
909905
3
910906
);
911907
assert_eq!(get_contract_balance(id, provider.clone()).await, 6); // extra amount (5) is forwarded to the contract

forc-plugins/forc-client/src/op/call/missing_contracts.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use anyhow::{bail, Result};
2+
use fuel_tx::ContractId;
23
use fuels::programs::calls::{
34
traits::TransactionTuner, utils::find_ids_of_missing_contracts, ContractCall,
45
};
@@ -7,9 +8,7 @@ use fuels_accounts::{
78
signers::private_key::PrivateKeySigner,
89
wallet::{Unlocked, Wallet},
910
};
10-
use fuels_core::types::{
11-
bech32::Bech32ContractId, transaction::TxPolicies, transaction_builders::VariableOutputPolicy,
12-
};
11+
use fuels_core::types::{transaction::TxPolicies, transaction_builders::VariableOutputPolicy};
1312

1413
/// Get the missing contracts from a contract call by dry-running the transaction
1514
/// to find contracts that are not explicitly listed in the call's `external_contracts` field.
@@ -21,7 +20,7 @@ pub async fn determine_missing_contracts(
2120
variable_output_policy: &VariableOutputPolicy,
2221
log_decoder: &fuels_core::codec::LogDecoder,
2322
account: &Wallet<Unlocked<PrivateKeySigner>>,
24-
) -> Result<Vec<Bech32ContractId>> {
23+
) -> Result<Vec<ContractId>> {
2524
let tb = call
2625
.transaction_builder(*tx_policies, *variable_output_policy, account)
2726
.await

forc-plugins/forc-client/src/op/call/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async fn get_wallet(
165165
let wallet = Wallet::new(signer, provider);
166166
forc_tracing::println_warning(&format!(
167167
"No signing key or wallet flag provided. Using default signer: 0x{}",
168-
wallet.address().hash()
168+
wallet.address()
169169
));
170170
Ok(wallet)
171171
}
@@ -174,7 +174,7 @@ async fn get_wallet(
174174
let wallet = Wallet::new(signer, provider);
175175
forc_tracing::println_warning(&format!(
176176
"Using account {} derived from signing key...",
177-
wallet.address().hash()
177+
wallet.address()
178178
));
179179
Ok(wallet)
180180
}
@@ -369,8 +369,8 @@ pub(crate) mod tests {
369369
.unwrap()
370370
.contract_id;
371371

372-
let instance = TestContract::new(id.clone(), wallet.clone());
372+
let instance = TestContract::new(id, wallet.clone());
373373

374-
(instance, id.into(), provider, secret_key)
374+
(instance, id, provider, secret_key)
375375
}
376376
}

0 commit comments

Comments
 (0)