Skip to content

Commit 55358da

Browse files
zees-devsdankelhal3e
authored
chore: upgrade fuels-rs sdk to 0.70 (#6851)
## Description Updated the `fuels-rs` SDK to `0.77`. This required updating transitive dependencies to the relevant versions specified in fuels-rs sdk. ## Dependency tree ```mermaid graph TD sway[sway] fuelsrs[fuels-rs] fuelabi[fuel-abi-types] fuelvm[fuel-vm] forcwallet[forc-wallet] fcoreclient[fuels-core] fvmprivate[fuel-vm-private] %% Main dependency relationships sway --> fuelsrs fuelsrs --> fuelabi fuelsrs --> fuelvm fuelsrs --> forcwallet fuelsrs --> fcoreclient %% Secondary dependencies fcoreclient --> fvmprivate fvmprivate --> fuelvm %% forc-wallet dependencies forcwallet --> fuelvm forcwallet --> fuelsrs %% Styling classDef primary fill:#d0e1f9,stroke:#4a90e2,stroke-width:2px classDef secondary fill:#e8f4ea,stroke:#66b366,stroke-width:2px class sway,fuelsrs primary class fuelabi,fuelvm,forcwallet,fcoreclient,fvmprivate secondary %% Add notes subgraph Note note[Update forc-wallet first due to circular dependency] style note fill:#fff4e6,stroke:#ffab40,stroke-width:1px end ``` ## Checklist - [ ] I have linked to any relevant issues. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [ ] 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 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). - [ ] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: z <zees-dev@users.noreply.github.com> Co-authored-by: Sophie Dankel <47993817+sdankel@users.noreply.github.com> Co-authored-by: hal3e <git@hal3e.io>
1 parent f0ed57a commit 55358da

File tree

18 files changed

+2168
-984
lines changed

18 files changed

+2168
-984
lines changed

Cargo.lock

+405-297
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+12-13
Original file line numberDiff line numberDiff line change
@@ -79,31 +79,31 @@ sway-ir-macros = { path = "sway-ir/sway-ir-macros", version = "0.66.6" }
7979
#
8080

8181
# Dependencies from the `fuel-abi-types` repository:
82-
fuel-abi-types = "0.7"
82+
fuel-abi-types = "0.8"
8383

8484
# Dependencies from the `fuel-core` repository:
8585
#
8686
# Although ALL verions are "X.Y", we need the complete semver for
8787
# fuel-core-client as the GitHub Actions workflow parses this value to pull down
8888
# the correct tarball
89-
fuel-core-client = { version = "0.40.0", default-features = false }
90-
fuel-core-types = { version = "0.40", default-features = false }
89+
fuel-core-client = { version = "0.41.4", default-features = false }
90+
fuel-core-types = { version = "0.41", default-features = false }
9191

9292
# Dependencies from the `fuels-rs` repository:
9393

94-
fuels = "0.66.10"
95-
fuels-core = "0.66.10"
96-
fuels-accounts = "0.66.10"
94+
fuels = "0.70"
95+
fuels-core = "0.70"
96+
fuels-accounts = "0.70"
9797

9898
# Dependencies from the `fuel-vm` repository:
99-
fuel-asm = "0.58"
100-
fuel-crypto = "0.58"
101-
fuel-types = "0.58"
102-
fuel-tx = "0.58"
103-
fuel-vm = "0.58"
99+
fuel-asm = "0.59"
100+
fuel-crypto = "0.59"
101+
fuel-types = "0.59"
102+
fuel-tx = "0.59"
103+
fuel-vm = "0.59"
104104

105105
# Dependencies from the `forc-wallet` repository:
106-
forc-wallet = "0.11"
106+
forc-wallet = "0.12"
107107

108108
#
109109
# External dependencies
@@ -129,7 +129,6 @@ comrak = "0.28"
129129
crossbeam-channel = "0.5"
130130
dap = "0.4.1-alpha"
131131
dashmap = "6.1"
132-
derivative = "2.2"
133132
devault = "0.2"
134133
dialoguer = "0.11"
135134
dirs = "5.0"

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use fuels::{
2222
transaction_builders::{BuildableTransaction, VariableOutputPolicy},
2323
},
2424
};
25-
use fuels_accounts::{provider::Provider, Account};
25+
use fuels_accounts::{provider::Provider, Account, ViewOnlyAccount};
2626
use pkg::BuiltPackage;
2727
use std::time::Duration;
2828
use std::{path::PathBuf, str::FromStr};

forc-plugins/forc-client/src/util/account.rs

+21-20
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,14 @@ pub enum ForcClientAccount {
2424

2525
#[async_trait]
2626
impl Account for ForcClientAccount {
27-
async fn get_asset_inputs_for_amount(
28-
&self,
29-
asset_id: AssetId,
30-
amount: u64,
31-
excluded_coins: Option<Vec<CoinTypeId>>,
32-
) -> Result<Vec<Input>> {
33-
match self {
34-
ForcClientAccount::Wallet(wallet) => {
35-
wallet
36-
.get_asset_inputs_for_amount(asset_id, amount, excluded_coins)
37-
.await
38-
}
39-
ForcClientAccount::KmsSigner(account) => {
40-
account
41-
.get_asset_inputs_for_amount(asset_id, amount, excluded_coins)
42-
.await
43-
}
44-
}
45-
}
46-
4727
fn add_witnesses<Tb: TransactionBuilder>(&self, tb: &mut Tb) -> Result<()> {
4828
tb.add_signer(self.clone())?;
4929

5030
Ok(())
5131
}
5232
}
5333

34+
#[async_trait]
5435
impl ViewOnlyAccount for ForcClientAccount {
5536
fn address(&self) -> &Bech32Address {
5637
match self {
@@ -67,6 +48,26 @@ impl ViewOnlyAccount for ForcClientAccount {
6748
ForcClientAccount::KmsSigner(account) => Ok(account.provider()),
6849
}
6950
}
51+
52+
async fn get_asset_inputs_for_amount(
53+
&self,
54+
asset_id: AssetId,
55+
amount: u64,
56+
excluded_coins: Option<Vec<CoinTypeId>>,
57+
) -> Result<Vec<Input>> {
58+
match self {
59+
ForcClientAccount::Wallet(wallet) => {
60+
wallet
61+
.get_asset_inputs_for_amount(asset_id, amount, excluded_coins)
62+
.await
63+
}
64+
ForcClientAccount::KmsSigner(account) => {
65+
account
66+
.get_asset_inputs_for_amount(asset_id, amount, excluded_coins)
67+
.await
68+
}
69+
}
70+
}
7071
}
7172

7273
#[async_trait]

forc-plugins/forc-client/src/util/aws.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ impl Signer for AwsSigner {
241241
}
242242
}
243243

244+
#[async_trait]
244245
impl ViewOnlyAccount for AwsSigner {
245246
fn address(&self) -> &Bech32Address {
246247
&self.bech
@@ -249,10 +250,7 @@ impl ViewOnlyAccount for AwsSigner {
249250
fn try_provider(&self) -> Result<&Provider> {
250251
Ok(&self.provider)
251252
}
252-
}
253253

254-
#[async_trait]
255-
impl Account for AwsSigner {
256254
async fn get_asset_inputs_for_amount(
257255
&self,
258256
asset_id: AssetId,
@@ -267,3 +265,6 @@ impl Account for AwsSigner {
267265
.collect::<Vec<Input>>())
268266
}
269267
}
268+
269+
#[async_trait]
270+
impl Account for AwsSigner {}

forc-plugins/forc-client/src/util/tx.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,13 @@ pub(crate) async fn select_account(
188188
let wallet_path = default_wallet_path();
189189
let accounts = collect_user_accounts(&wallet_path, password)?;
190190
let account_balances = collect_account_balances(&accounts, provider).await?;
191-
let base_asset_id = provider.base_asset_id();
191+
let consensus_parameters = provider.consensus_parameters().await?;
192+
let base_asset_id = consensus_parameters.base_asset_id();
192193

193194
let total_balance = account_balances
194195
.iter()
195196
.flat_map(|account| account.values())
196-
.sum::<u64>();
197+
.sum::<u128>();
197198
if total_balance == 0 {
198199
let first_account = accounts
199200
.get(&0)

forc-plugins/forc-client/tests/deploy.rs

+11-9
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,8 @@ async fn test_non_owner_fails_to_set_target() {
657657
SecretKey::from_str(forc_client::constants::DEFAULT_PRIVATE_KEY).unwrap();
658658
let owner_wallet =
659659
WalletUnlocked::new_from_private_key(owner_secret_key, Some(provider.clone()));
660-
let base_asset_id = provider.base_asset_id();
660+
let consensus_parameters = provider.consensus_parameters().await.unwrap();
661+
let base_asset_id = consensus_parameters.base_asset_id();
661662

662663
// Fund attacker wallet so that it can try to make a set proxy target call.
663664
owner_wallet
@@ -1052,7 +1053,8 @@ async fn deployed_predicate_call() {
10521053
));
10531054

10541055
let provider = Provider::connect(&node_url).await.unwrap();
1055-
let base_asset_id = *provider.base_asset_id();
1056+
let consensus_parameters = provider.consensus_parameters().await.unwrap();
1057+
let base_asset_id = consensus_parameters.base_asset_id();
10561058
let secret_key = SecretKey::from_str(forc_client::constants::DEFAULT_PRIVATE_KEY).unwrap();
10571059
let wallet_unlocked = WalletUnlocked::new_from_private_key(secret_key, Some(provider.clone()));
10581060
let loader_path = tmp_dir.path().join("out/deployed_predicate-loader.bin");
@@ -1074,32 +1076,32 @@ async fn deployed_predicate_call() {
10741076
wallet_unlocked
10751077
.transfer(
10761078
predicate.address(),
1077-
500,
1078-
base_asset_id,
1079+
2000,
1080+
*base_asset_id,
10791081
TxPolicies::default(),
10801082
)
10811083
.await
10821084
.unwrap();
10831085

10841086
// Check predicate balance.
1085-
let balance = predicate.get_asset_balance(&base_asset_id).await.unwrap();
1086-
assert_eq!(balance, 500);
1087+
let balance = predicate.get_asset_balance(base_asset_id).await.unwrap();
1088+
assert_eq!(balance, 2000);
10871089

10881090
// Try to spend it
10891091
let amount_to_unlock = 300;
10901092
predicate
10911093
.transfer(
10921094
wallet_unlocked.address(),
10931095
amount_to_unlock,
1094-
base_asset_id,
1096+
*base_asset_id,
10951097
TxPolicies::default(),
10961098
)
10971099
.await
10981100
.unwrap();
10991101

11001102
// Check predicate balance again.
1101-
let balance = predicate.get_asset_balance(&base_asset_id).await.unwrap();
1102-
assert_eq!(balance, 200);
1103+
let balance = predicate.get_asset_balance(base_asset_id).await.unwrap();
1104+
assert_eq!(balance, 828);
11031105

11041106
node.kill().unwrap();
11051107
}

forc-test/src/execute.rs

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ impl TestExecutor {
120120
gas_price,
121121
consensus_params.gas_costs(),
122122
consensus_params.fee_params(),
123+
None,
123124
)
124125
.map_err(|e| anyhow::anyhow!("{e:?}"))?;
125126

forc-test/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl PackageWithDeploymentToTest {
230230
.map(|(contract_id, tx)| {
231231
// Transact the deployment transaction constructed for this contract dependency.
232232
let tx = tx
233-
.into_ready(gas_price, params.gas_costs(), params.fee_params())
233+
.into_ready(gas_price, params.gas_costs(), params.fee_params(), None)
234234
.unwrap();
235235
interpreter.transact(tx).map_err(anyhow::Error::msg)?;
236236
Ok(contract_id)
@@ -247,7 +247,7 @@ impl PackageWithDeploymentToTest {
247247
&params,
248248
);
249249
let root_contract_tx = root_contract_tx
250-
.into_ready(gas_price, params.gas_costs(), params.fee_params())
250+
.into_ready(gas_price, params.gas_costs(), params.fee_params(), None)
251251
.unwrap();
252252
// Deploy the root contract.
253253
interpreter

sway-core/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ repository.workspace = true
1010

1111
[dependencies]
1212
clap = { workspace = true, features = ["derive"] }
13-
derivative.workspace = true
1413
dirs.workspace = true
1514
either.workspace = true
1615
ethabi.workspace = true

sway-core/src/asm_generation/finalized_asm.rs

+2
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@ fn print_instruction(op: &Instruction) {
599599
Instruction::ECAL(x) => f("ECAL", x.unpack()),
600600
Instruction::BSIZ(x) => f("BSIZ", x.unpack()),
601601
Instruction::BLDD(x) => f("BLDD", x.unpack()),
602+
Instruction::ECOP(x) => f("ECOP", x.unpack()),
603+
Instruction::EPAR(x) => f("EPAR", x.unpack()),
602604
}
603605
}
604606

test/src/e2e_vm_tests/harness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pub(crate) fn runs_in_vm(
203203

204204
let tx = tb
205205
.finalize_checked(block_height)
206-
.into_ready(gas_price, params.gas_costs(), params.fee_params())
206+
.into_ready(gas_price, params.gas_costs(), params.fee_params(), None)
207207
.map_err(|e| anyhow::anyhow!("{e:?}"))?;
208208

209209
let mem_instance = MemoryInstance::new();

0 commit comments

Comments
 (0)