From 98d821b6ed404a7018453db8530eda03fde44067 Mon Sep 17 00:00:00 2001 From: Sophie Dankel <47993817+sdankel@users.noreply.github.com> Date: Mon, 14 Oct 2024 21:00:25 -0700 Subject: [PATCH 1/2] add new target to forc (#6621) ## Description ## 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: Alfie John Co-authored-by: Joshua Batty --- .../src/forc/plugins/forc_client/index.md | 18 ++-- forc-plugins/forc-client/src/cmd/deploy.rs | 2 +- forc-plugins/forc-client/src/constants.rs | 14 +-- forc-plugins/forc-client/src/lib.rs | 18 ++-- forc-plugins/forc-client/src/op/deploy.rs | 6 +- forc-plugins/forc-client/src/util/node_url.rs | 86 +++++++------------ forc-plugins/forc-client/src/util/target.rs | 67 +++++---------- forc-plugins/forc-client/src/util/tx.rs | 19 ++-- forc-plugins/forc-client/tests/deploy.rs | 16 ++++ 9 files changed, 115 insertions(+), 131 deletions(-) diff --git a/docs/book/src/forc/plugins/forc_client/index.md b/docs/book/src/forc/plugins/forc_client/index.md index 13800088b96..feb436af788 100644 --- a/docs/book/src/forc/plugins/forc_client/index.md +++ b/docs/book/src/forc/plugins/forc_client/index.md @@ -92,24 +92,30 @@ By default `--default-signer` flag would sign your transactions with the followi 0xde97d8624a438121b86a1956544bd72ed68cd69f2c99555b08b1e8c51ffd511c ``` -## Interacting with the testnet +## Selecting a target network -To interact with the latest testnet, use the `--testnet` flag. When this flag is passed, transactions created by `forc-deploy` will be sent to the latest `testnet`. +By default, `local` is used for the target network. To interact with the latest testnet, use the `--testnet` flag. When this flag is passed, transactions created by `forc-deploy` will be sent to the latest `testnet`: ```sh forc-deploy --testnet ``` -It is also possible to pass the exact node URL while using `forc-deploy` or `forc-run` which can be done using `--node-url` flag. +The same can be done to target mainnet: ```sh -forc-deploy --node-url https://beta-3.fuel.network +forc-deploy --mainnet ``` -Another alternative is the `--target` option, which provides useful aliases to all targets. For example if you want to deploy to `beta-5` you can use: +It is also possible to pass the exact node URL while using `forc-deploy` or `forc-run` which can be done using `--node-url` flag: ```sh -forc-deploy --target beta-5 +forc-deploy --node-url https://mainnet.fuel.network +``` + +Another alternative is the `--target` option, which provides useful aliases to all targets. For example if you want to deploy to `testnet` you can use: + +```sh +forc-deploy --target testnet ``` Since deploying and running projects on the testnet cost gas, you will need coins to pay for them. You can get some using the [testnet faucet](https://faucet-testnet.fuel.network/). diff --git a/forc-plugins/forc-client/src/cmd/deploy.rs b/forc-plugins/forc-client/src/cmd/deploy.rs index 5553a2fe06b..87428dfbca7 100644 --- a/forc-plugins/forc-client/src/cmd/deploy.rs +++ b/forc-plugins/forc-client/src/cmd/deploy.rs @@ -10,7 +10,7 @@ forc_util::cli_examples! { super::Command { [ Deploy a single contract => "forc deploy bc09bfa7a11a04ce42b0a5abf04fd437387ee49bf4561d575177e2946468b408" ] [ Deploy a single contract from a different path => "forc deploy bc09bfa7a11a04ce42b0a5abf04fd437387ee49bf4561d575177e2946468b408 --path {path}" ] - [ Deploy to a custom network => "forc deploy --node-url https://beta-5.fuel.network/graphql" ] + [ Deploy to a custom network => "forc deploy --node-url https://testnet.fuel.network/graphql" ] } } diff --git a/forc-plugins/forc-client/src/constants.rs b/forc-plugins/forc-client/src/constants.rs index f6e1faa4201..1b195f733e6 100644 --- a/forc-plugins/forc-client/src/constants.rs +++ b/forc-plugins/forc-client/src/constants.rs @@ -1,20 +1,12 @@ /// Default to localhost to favour the common case of testing. pub const NODE_URL: &str = sway_utils::constants::DEFAULT_NODE_URL; -pub const BETA_2_ENDPOINT_URL: &str = "https://node-beta-2.fuel.network"; -pub const BETA_3_ENDPOINT_URL: &str = "https://beta-3.fuel.network"; -pub const BETA_4_ENDPOINT_URL: &str = "https://beta-4.fuel.network"; -pub const BETA_5_ENDPOINT_URL: &str = "https://beta-5.fuel.network"; -pub const DEVNET_ENDPOINT_URL: &str = "https://devnet.fuel.network"; pub const TESTNET_ENDPOINT_URL: &str = "https://testnet.fuel.network"; +pub const MAINNET_ENDPOINT_URL: &str = "https://mainnet.fuel.network"; -pub const BETA_2_FAUCET_URL: &str = "https://faucet-beta-2.fuel.network"; -pub const BETA_3_FAUCET_URL: &str = "https://faucet-beta-3.fuel.network"; -pub const BETA_4_FAUCET_URL: &str = "https://faucet-beta-4.fuel.network"; -pub const BETA_5_FAUCET_URL: &str = "https://faucet-beta-5.fuel.network"; -pub const DEVNET_FAUCET_URL: &str = "https://faucet-devnet.fuel.network"; pub const TESTNET_FAUCET_URL: &str = "https://faucet-testnet.fuel.network"; -pub const TESTNET_EXPLORER_URL: &str = "https://app.fuel.network"; +pub const TESTNET_EXPLORER_URL: &str = "https://app-testnet.fuel.network"; +pub const MAINNET_EXPLORER_URL: &str = "https://app.fuel.network"; /// Default PrivateKey to sign transactions submitted to local node. pub const DEFAULT_PRIVATE_KEY: &str = diff --git a/forc-plugins/forc-client/src/lib.rs b/forc-plugins/forc-client/src/lib.rs index cce5e5ab95e..a4db6b262a1 100644 --- a/forc-plugins/forc-client/src/lib.rs +++ b/forc-plugins/forc-client/src/lib.rs @@ -14,19 +14,27 @@ pub struct NodeTarget { /// If unspecified, checks the manifest's `network` table, then falls back /// to `http://127.0.0.1:4000` /// - /// You can also use `--target` or `--testnet` to specify the Fuel node. + /// You can also use `--target`, `--testnet`, or `--mainnet` to specify the Fuel node. #[clap(long, env = "FUEL_NODE_URL")] pub node_url: Option, + /// Use preset configurations for deploying to a specific target. /// - /// You can also use `--node-url` or `--testnet` to specify the Fuel node. + /// You can also use `--node-url`, `--testnet`, or `--mainnet` to specify the Fuel node. /// - /// Possible values are: [beta-1, beta-2, beta-3, beta-4, local] + /// Possible values are: [local, testnet, mainnet] #[clap(long)] pub target: Option, - /// Use preset configuration for the latest testnet. + + /// Use preset configuration for testnet. /// - /// You can also use `--node-url` or `--target` to specify the Fuel node. + /// You can also use `--node-url`, `--target`, or `--mainnet` to specify the Fuel node. #[clap(long)] pub testnet: bool, + + /// Use preset configuration for mainnet. + /// + /// You can also use `--node-url`, `--target`, or `--testnet` to specify the Fuel node. + #[clap(long)] + pub mainnet: bool, } diff --git a/forc-plugins/forc-client/src/op/deploy.rs b/forc-plugins/forc-client/src/op/deploy.rs index 798fd788826..cdc5d35162c 100644 --- a/forc-plugins/forc-client/src/op/deploy.rs +++ b/forc-plugins/forc-client/src/op/deploy.rs @@ -192,7 +192,7 @@ async fn deploy_chunked( let storage_slots = resolve_storage_slots(command, compiled)?; let chain_info = provider.chain_info().await?; - let target = Target::from_str(&chain_info.name).unwrap_or(Target::testnet()); + let target = Target::from_str(&chain_info.name).unwrap_or_default(); let contract_url = match target.explorer_url() { Some(explorer_url) => format!("{explorer_url}/contract/0x"), None => "".to_string(), @@ -257,7 +257,7 @@ async fn deploy_new_proxy( .into(); let chain_info = provider.chain_info().await?; - let target = Target::from_str(&chain_info.name).unwrap_or(Target::testnet()); + let target = Target::from_str(&chain_info.name).unwrap_or_default(); let contract_url = match target.explorer_url() { Some(explorer_url) => format!("{explorer_url}/contract/0x"), None => "".to_string(), @@ -948,7 +948,7 @@ fn create_deployment_artifact( let contract_id = ContractId::from_str(&deployment_artifact.contract_id).unwrap(); let pkg_name = manifest.project_name(); - let target = Target::from_str(&chain_info.name).unwrap_or(Target::testnet()); + let target = Target::from_str(&chain_info.name).unwrap_or_default(); let (contract_url, block_url) = match target.explorer_url() { Some(explorer_url) => ( format!("{explorer_url}/contract/0x"), diff --git a/forc-plugins/forc-client/src/util/node_url.rs b/forc-plugins/forc-client/src/util/node_url.rs index b7fe3f8bf39..58e9dcd87e1 100644 --- a/forc-plugins/forc-client/src/util/node_url.rs +++ b/forc-plugins/forc-client/src/util/node_url.rs @@ -12,18 +12,22 @@ pub fn get_node_url( ) -> Result { let node_url = match ( node_target.testnet, + node_target.mainnet, node_target.target.clone(), node_target.node_url.clone(), ) { - (true, None, None) => Target::testnet().target_url(), - (false, Some(target), None) => target.target_url(), - (false, None, Some(node_url)) => node_url, - (false, None, None) => manifest_network + (true, false, None, None) => Target::testnet().target_url(), + (false, true, None, None) => Target::mainnet().target_url(), + (false, false, Some(target), None) => target.target_url(), + (false, false, None, Some(node_url)) => node_url, + (false, false, None, None) => manifest_network .as_ref() .map(|nw| &nw.url[..]) .unwrap_or(crate::constants::NODE_URL) .to_string(), - _ => bail!("Only one of `--testnet`, `--target`, or `--node-url` should be specified"), + _ => bail!( + "Only one of `--testnet`, `--mainnet`, `--target`, or `--node-url` should be specified" + ), }; Ok(node_url) @@ -35,6 +39,7 @@ fn test_get_node_url_testnet() { target: None, node_url: None, testnet: true, + mainnet: false, }; let actual = get_node_url(&input, &None).unwrap(); @@ -42,63 +47,41 @@ fn test_get_node_url_testnet() { } #[test] -fn test_get_node_url_target_devnet() { +fn test_get_node_url_mainnet() { let input = NodeTarget { - target: Some(Target::Devnet), - node_url: None, - testnet: false, - }; - let actual = get_node_url(&input, &None).unwrap(); - assert_eq!("https://devnet.fuel.network", actual); -} - -#[test] -fn test_get_node_url_target_testnet() { - let input = NodeTarget { - target: Some(Target::Testnet), + target: None, node_url: None, testnet: false, + mainnet: true, }; let actual = get_node_url(&input, &None).unwrap(); - assert_eq!("https://testnet.fuel.network", actual); + assert_eq!("https://mainnet.fuel.network", actual); } #[test] -fn test_get_node_url_beta5() { +fn test_get_node_url_target_mainnet() { let input = NodeTarget { - target: Some(Target::Beta5), + target: Some(Target::Mainnet), node_url: None, testnet: false, + mainnet: false, }; let actual = get_node_url(&input, &None).unwrap(); - assert_eq!("https://beta-5.fuel.network", actual); + assert_eq!("https://mainnet.fuel.network", actual); } #[test] -fn test_get_node_url_beta4() { - let input = NodeTarget { - target: None, - node_url: Some("https://beta-4.fuel.network".to_string()), - testnet: false, - }; - let actual = get_node_url(&input, &None).unwrap(); - assert_eq!("https://beta-4.fuel.network", actual); -} - -#[test] -fn test_get_node_url_url_beta4_manifest() { - let network = Network { - url: "https://beta-4.fuel.network".to_string(), - }; +fn test_get_node_url_target_testnet() { let input = NodeTarget { - target: None, + target: Some(Target::Testnet), node_url: None, testnet: false, + mainnet: false, }; - let actual = get_node_url(&input, &Some(network)).unwrap(); - assert_eq!("https://beta-4.fuel.network", actual); + let actual = get_node_url(&input, &None).unwrap(); + assert_eq!("https://testnet.fuel.network", actual); } #[test] @@ -107,29 +90,20 @@ fn test_get_node_url_default() { target: None, node_url: None, testnet: false, + mainnet: false, }; let actual = get_node_url(&input, &None).unwrap(); assert_eq!("http://127.0.0.1:4000", actual); } -#[test] -fn test_get_node_url_beta3() { - let input = NodeTarget { - target: Some(Target::Beta3), - node_url: None, - testnet: false, - }; - let actual = get_node_url(&input, &None).unwrap(); - assert_eq!("https://beta-3.fuel.network", actual); -} - #[test] fn test_get_node_url_local() { let input = NodeTarget { target: Some(Target::Local), node_url: None, testnet: false, + mainnet: false, }; let actual = get_node_url(&input, &None).unwrap(); assert_eq!("http://127.0.0.1:4000", actual); @@ -137,26 +111,28 @@ fn test_get_node_url_local() { #[test] #[should_panic( - expected = "Only one of `--testnet`, `--target`, or `--node-url` should be specified" + expected = "Only one of `--testnet`, `--mainnet`, `--target`, or `--node-url` should be specified" )] fn test_get_node_url_local_testnet() { let input = NodeTarget { target: Some(Target::Local), node_url: None, testnet: true, + mainnet: false, }; get_node_url(&input, &None).unwrap(); } #[test] #[should_panic( - expected = "Only one of `--testnet`, `--target`, or `--node-url` should be specified" + expected = "Only one of `--testnet`, `--mainnet`, `--target`, or `--node-url` should be specified" )] fn test_get_node_url_same_url() { let input = NodeTarget { - target: Some(Target::Beta3), - node_url: Some("beta-3.fuel.network".to_string()), + target: Some(Target::Testnet), + node_url: Some("testnet.fuel.network".to_string()), testnet: false, + mainnet: false, }; get_node_url(&input, &None).unwrap(); } diff --git a/forc-plugins/forc-client/src/util/target.rs b/forc-plugins/forc-client/src/util/target.rs index 86b9b947666..3982f91ce07 100644 --- a/forc-plugins/forc-client/src/util/target.rs +++ b/forc-plugins/forc-client/src/util/target.rs @@ -1,8 +1,6 @@ use crate::constants::{ - BETA_2_ENDPOINT_URL, BETA_2_FAUCET_URL, BETA_3_ENDPOINT_URL, BETA_3_FAUCET_URL, - BETA_4_ENDPOINT_URL, BETA_4_FAUCET_URL, BETA_5_ENDPOINT_URL, BETA_5_FAUCET_URL, - DEVNET_ENDPOINT_URL, DEVNET_FAUCET_URL, NODE_URL, TESTNET_ENDPOINT_URL, TESTNET_EXPLORER_URL, - TESTNET_FAUCET_URL, + MAINNET_ENDPOINT_URL, MAINNET_EXPLORER_URL, NODE_URL, TESTNET_ENDPOINT_URL, + TESTNET_EXPLORER_URL, TESTNET_FAUCET_URL, }; use anyhow::{bail, Result}; use serde::{Deserialize, Serialize}; @@ -11,12 +9,8 @@ use std::str::FromStr; #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] /// Possible target values that forc-client can interact with. pub enum Target { - Beta2, - Beta3, - Beta4, - Beta5, - Devnet, Testnet, + Mainnet, Local, } @@ -29,12 +23,8 @@ impl Default for Target { impl Target { pub fn target_url(&self) -> String { let url = match self { - Target::Beta2 => BETA_2_ENDPOINT_URL, - Target::Beta3 => BETA_3_ENDPOINT_URL, - Target::Beta4 => BETA_4_ENDPOINT_URL, - Target::Beta5 => BETA_5_ENDPOINT_URL, - Target::Devnet => DEVNET_ENDPOINT_URL, Target::Testnet => TESTNET_ENDPOINT_URL, + Target::Mainnet => MAINNET_ENDPOINT_URL, Target::Local => NODE_URL, }; url.to_string() @@ -42,36 +32,37 @@ impl Target { pub fn from_target_url(target_url: &str) -> Option { match target_url { - BETA_2_ENDPOINT_URL => Some(Target::Beta2), - BETA_3_ENDPOINT_URL => Some(Target::Beta3), - BETA_4_ENDPOINT_URL => Some(Target::Beta4), - BETA_5_ENDPOINT_URL => Some(Target::Beta5), - DEVNET_ENDPOINT_URL => Some(Target::Devnet), TESTNET_ENDPOINT_URL => Some(Target::Testnet), + MAINNET_ENDPOINT_URL => Some(Target::Mainnet), NODE_URL => Some(Target::Local), _ => None, } } + pub fn local() -> Self { + Target::Local + } + pub fn testnet() -> Self { Target::Testnet } - pub fn faucet_url(&self) -> String { + pub fn mainnet() -> Self { + Target::Mainnet + } + + pub fn faucet_url(&self) -> Option { match self { - Target::Beta2 => BETA_2_FAUCET_URL.to_string(), - Target::Beta3 => BETA_3_FAUCET_URL.to_string(), - Target::Beta4 => BETA_4_FAUCET_URL.to_string(), - Target::Beta5 => BETA_5_FAUCET_URL.to_string(), - Target::Devnet => DEVNET_FAUCET_URL.to_string(), - Target::Testnet => TESTNET_FAUCET_URL.to_string(), - Target::Local => "http://localhost:3000".to_string(), + Target::Testnet => Some(TESTNET_FAUCET_URL.to_string()), + Target::Mainnet => None, + Target::Local => Some("http://localhost:3000".to_string()), } } pub fn explorer_url(&self) -> Option { match self { - Target::Testnet | Target::Devnet => Some(TESTNET_EXPLORER_URL.to_string()), + Target::Testnet => Some(TESTNET_EXPLORER_URL.to_string()), + Target::Mainnet => Some(MAINNET_EXPLORER_URL.to_string()), _ => None, } } @@ -82,21 +73,13 @@ impl FromStr for Target { fn from_str(s: &str) -> Result { match s { - "beta-2" => Ok(Target::Beta2), - "beta-3" => Ok(Target::Beta3), - "beta-4" => Ok(Target::Beta4), - "beta-5" => Ok(Target::Beta5), - "devnet" => Ok(Target::Devnet), "testnet" => Ok(Target::Testnet), + "mainnet" => Ok(Target::Mainnet), "local" => Ok(Target::Local), _ => bail!( - "'{s}' is not a valid target name. Possible values: '{}', '{}', '{}', '{}', '{}', '{}', '{}'", - Target::Beta2, - Target::Beta3, - Target::Beta4, - Target::Beta5, - Target::Devnet, + "'{s}' is not a valid target name. Possible values: '{}', '{}', '{}'", Target::Testnet, + Target::Mainnet, Target::Local ), } @@ -106,12 +89,8 @@ impl FromStr for Target { impl std::fmt::Display for Target { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let s = match self { - Target::Beta2 => "beta-2", - Target::Beta3 => "beta-3", - Target::Beta4 => "beta-4", - Target::Beta5 => "beta-5", - Target::Devnet => "devnet", Target::Testnet => "testnet", + Target::Mainnet => "mainnet", Target::Local => "local", }; write!(f, "{}", s) diff --git a/forc-plugins/forc-client/src/util/tx.rs b/forc-plugins/forc-client/src/util/tx.rs index d5a002e809f..d1ceb751194 100644 --- a/forc-plugins/forc-client/src/util/tx.rs +++ b/forc-plugins/forc-client/src/util/tx.rs @@ -181,12 +181,19 @@ pub(crate) async fn select_account( let first_account = accounts .get(&0) .ok_or_else(|| anyhow::anyhow!("No account derived for this wallet"))?; - let target = Target::from_str(&chain_info.name).unwrap_or(Target::testnet()); - let faucet_link = format!("{}/?address={first_account}", target.faucet_url()); - anyhow::bail!("Your wallet does not have any funds to pay for the transaction.\ - \n\nIf you are interacting with a testnet consider using the faucet.\ - \n-> {target} network faucet: {faucet_link}\ - \nIf you are interacting with a local node, consider providing a chainConfig which funds your account.") + let target = Target::from_str(&chain_info.name).unwrap_or_default(); + let message = if let Some(faucet_url) = target.faucet_url() { + format!( + "Your wallet does not have any funds to pay for the transaction.\ + \n\nIf you are interacting with a testnet, consider using the faucet.\ + \n-> {target} network faucet: {}/?address={first_account}\ + \nIf you are interacting with a local node, consider providing a chainConfig which funds your account.", + faucet_url + ) + } else { + "Your wallet does not have any funds to pay for the transaction.".to_string() + }; + anyhow::bail!(message) } let selections = format_base_asset_account_balances(&accounts, &account_balances, base_asset_id); diff --git a/forc-plugins/forc-client/tests/deploy.rs b/forc-plugins/forc-client/tests/deploy.rs index adb83853318..e1f416062ff 100644 --- a/forc-plugins/forc-client/tests/deploy.rs +++ b/forc-plugins/forc-client/tests/deploy.rs @@ -360,6 +360,7 @@ async fn test_simple_deploy() { node_url: Some(node_url), target: None, testnet: false, + mainnet: false, }; let cmd = cmd::Deploy { pkg, @@ -401,6 +402,7 @@ async fn test_deploy_submit_only() { node_url: Some(node_url), target: None, testnet: false, + mainnet: false, }; let cmd = cmd::Deploy { pkg, @@ -447,6 +449,7 @@ async fn test_deploy_fresh_proxy() { node_url: Some(node_url), target: None, testnet: false, + mainnet: false, }; let cmd = cmd::Deploy { pkg, @@ -498,6 +501,7 @@ async fn test_proxy_contract_re_routes_call() { node_url: Some(node_url.clone()), target: None, testnet: false, + mainnet: false, }; let cmd = cmd::Deploy { pkg, @@ -555,6 +559,7 @@ async fn test_proxy_contract_re_routes_call() { node_url: Some(node_url.clone()), target: None, testnet: false, + mainnet: false, }; let pkg = Pkg { path: Some(tmp_dir.path().display().to_string()), @@ -629,6 +634,7 @@ async fn test_non_owner_fails_to_set_target() { node_url: Some(node_url.clone()), target: None, testnet: false, + mainnet: false, }; let cmd = cmd::Deploy { pkg, @@ -732,6 +738,7 @@ async fn chunked_deploy() { node_url: Some(node_url), target: None, testnet: false, + mainnet: false, }; let cmd = cmd::Deploy { pkg, @@ -764,6 +771,7 @@ async fn chunked_deploy_re_routes_calls() { node_url: Some(node_url.clone()), target: None, testnet: false, + mainnet: false, }; let cmd = cmd::Deploy { pkg, @@ -806,6 +814,7 @@ async fn chunked_deploy_with_proxy_re_routes_call() { node_url: Some(node_url.clone()), target: None, testnet: false, + mainnet: false, }; let cmd = cmd::Deploy { pkg, @@ -838,6 +847,7 @@ async fn can_deploy_script() { node_url: Some(node_url.clone()), target: None, testnet: false, + mainnet: false, }; let pkg = Pkg { path: Some(tmp_dir.path().display().to_string()), @@ -868,6 +878,7 @@ async fn deploy_script_calls() { node_url: Some(node_url.clone()), target: None, testnet: false, + mainnet: false, }; let pkg = Pkg { path: Some(tmp_dir.path().display().to_string()), @@ -899,6 +910,7 @@ async fn deploy_script_calls() { node_url: Some(node_url.clone()), target: None, testnet: false, + mainnet: false, }; let cmd = cmd::Deploy { pkg, @@ -989,6 +1001,7 @@ async fn can_deploy_predicates() { node_url: Some(node_url.clone()), target: None, testnet: false, + mainnet: false, }; let pkg = Pkg { path: Some(tmp_dir.path().display().to_string()), @@ -1019,6 +1032,7 @@ async fn deployed_predicate_call() { node_url: Some(node_url.clone()), target: None, testnet: false, + mainnet: false, }; let pkg = Pkg { path: Some(tmp_dir.path().display().to_string()), @@ -1164,6 +1178,7 @@ async fn call_with_forc_generated_overrides(node_url: &str, contract_id: Contrac node_url: Some(node_url.to_string()), target: None, testnet: false, + mainnet: false, }; let pkg = Pkg { path: Some(tmp_dir.path().display().to_string()), @@ -1273,6 +1288,7 @@ async fn offset_shifted_abi_works() { node_url: Some(node_url.clone()), target: None, testnet: false, + mainnet: false, }; let cmd = cmd::Deploy { pkg, From 7c7f27b85aa3a15b6c85345becb821caf580d14e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaya=20G=C3=B6kalp?= Date: Tue, 15 Oct 2024 02:19:14 -0700 Subject: [PATCH 2/2] feat: bump fuel-core to v0.40.0 and sdk to v0.66.9 + show checksum addresses in forc-deploy (#6630) ## Description Bumps fuel-core v0.40.0 and SDK to 0.66.9. Also updates the account selection phase of forc-deploy to show check sum encoded address. image --- Cargo.lock | 98 ++++--- Cargo.toml | 12 +- forc-plugins/forc-client/src/util/target.rs | 8 +- forc-plugins/forc-client/src/util/tx.rs | 35 ++- test/src/sdk-harness/Cargo.lock | 308 +++++++++++--------- test/src/sdk-harness/Cargo.toml | 6 +- 6 files changed, 266 insertions(+), 201 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88b6b8e6464..d084c00dcf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2983,9 +2983,9 @@ dependencies = [ [[package]] name = "forc-wallet" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed8ee5063d7acc9b7dbdc5bdd43171e2bdcee5171b54939d1876f1b4fb01f6b" +checksum = "4e6ad4498ecab72fa7c5e134ade0137279d1b8f4a6df50963bb3803fdeb69dac" dependencies = [ "anyhow", "clap 4.5.16", @@ -3065,9 +3065,9 @@ dependencies = [ [[package]] name = "fuel-asm" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79ca07227658105bdf873556dea09fa7fbfe792fbc084b4b9568f5ba3d64c411" +checksum = "5f325971bf9047ec70004f80a989e03456316bc19cbef3ff3a39a38b192ab56e" dependencies = [ "bitflags 2.6.0", "fuel-types", @@ -3077,9 +3077,9 @@ dependencies = [ [[package]] name = "fuel-core-chain-config" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd1eca1d12daf8ad0f2479d7fff9405d94b6467496e5319e5f8b99cbdabdd58b" +checksum = "990db3029efd3766c4ae7c92a53c159ae66abf6f568ac6a3d58354f11400e6e2" dependencies = [ "anyhow", "bech32", @@ -3097,9 +3097,9 @@ dependencies = [ [[package]] name = "fuel-core-client" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbd88f285afdf061e409b712ecef49e2fe9ba235288cc76e8de8f05d50b6876" +checksum = "f09b3a35e82226d77b10653829beb508dc4bcf698fbdaa96610faf894e794444" dependencies = [ "anyhow", "base64 0.22.1", @@ -3122,22 +3122,25 @@ dependencies = [ [[package]] name = "fuel-core-metrics" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc199e165e600f241cab86129766b26bab78572a701a39bc40a5fdb669961a8" +checksum = "94a1c3eb92040d95d27f7c658801bb5c04ad4aaf67de380cececbeed5aab6e61" dependencies = [ + "once_cell", "parking_lot 0.12.3", "pin-project-lite", "prometheus-client", "regex", + "strum 0.25.0", + "strum_macros 0.25.3", "tracing", ] [[package]] name = "fuel-core-poa" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49c4f3e5fa1e916793609bdb9a52142077a84a793272379a04cf24375aa94e6f" +checksum = "2f6f78fa31dc56b9458e3ca9a7058b4bea381e16e49fcab0db49923be8a30f9c" dependencies = [ "anyhow", "async-trait", @@ -3154,24 +3157,25 @@ dependencies = [ [[package]] name = "fuel-core-services" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "739dca83db1eb86651db3833f088f52afcd3f181cfca40e5725074aceb3ea49d" +checksum = "8312b598da4b9a6503c9263c1c2a7ea58d34ab1f86e7f345490e12d309fb29bb" dependencies = [ "anyhow", "async-trait", "fuel-core-metrics", "futures", "parking_lot 0.12.3", + "pin-project-lite", "tokio", "tracing", ] [[package]] name = "fuel-core-storage" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6255d852b6866199d103233e1eef2e7ded141019bc782b5b211fcf001727c34b" +checksum = "bda9242ebc9e8ef3251b9eae85f4ce5cdb376348baa30925606f3ce602db7ec5" dependencies = [ "anyhow", "derive_more 0.99.18", @@ -3191,9 +3195,9 @@ dependencies = [ [[package]] name = "fuel-core-types" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a4e9b2de06381e1ad598cd1030344993fee7401331ca9955d0a1860cc0484c" +checksum = "6ee3a95b189bf729d21354a761862bb481298cbd883550adc3fef1bc7beb0b67" dependencies = [ "anyhow", "bs58", @@ -3209,9 +3213,9 @@ dependencies = [ [[package]] name = "fuel-crypto" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f53b06525aa7754bf7c3ef23daf15fd798ae990a82f8b7b813d25cedfeacfe5c" +checksum = "65e318850ca64890ff123a99b6b866954ef49da94ab9bc6827cf6ee045568585" dependencies = [ "coins-bip32", "coins-bip39", @@ -3230,9 +3234,9 @@ dependencies = [ [[package]] name = "fuel-derive" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e34d6eec30d04506607cc0bc85fc97c57c964580cd233fd557e346c5273535" +checksum = "ab0bc46a3552964bae5169e79b383761a54bd115ea66951a1a7a229edcefa55a" dependencies = [ "proc-macro2", "quote", @@ -3289,9 +3293,9 @@ dependencies = [ [[package]] name = "fuel-merkle" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9fa3708405eba32fd2b947b827dc52484377ba6a238260b03a07b642395e6c" +checksum = "c79eca6a452311c70978a5df796c0f99f27e474b69719e0db4c1d82e68800d07" dependencies = [ "derive_more 0.99.18", "digest 0.10.7", @@ -3304,15 +3308,15 @@ dependencies = [ [[package]] name = "fuel-storage" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f678f1c900d0632d77e15d4a4946048d4d517fefeba72607390c03288ca127" +checksum = "2d0c46b5d76b3e11197bd31e036cd8b1cb46c4d822cacc48836638080c6d2b76" [[package]] name = "fuel-tx" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e3065c12eecc9121514694f4b01009c9a83d8842af11c43ec9e2bbc0a7f36cb" +checksum = "6723bb8710ba2b70516ac94d34459593225870c937670fb3afaf82e0354667ac" dependencies = [ "bitflags 2.6.0", "derivative", @@ -3332,9 +3336,9 @@ dependencies = [ [[package]] name = "fuel-types" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a93d5f3fd028d874d8927be439fcdea01cb04499049bc68a874c73dd0c7e32b7" +checksum = "982265415a99b5bd6277bc24194a233bb2e18764df11c937b3dbb11a02c9e545" dependencies = [ "fuel-derive", "hex", @@ -3344,9 +3348,9 @@ dependencies = [ [[package]] name = "fuel-vm" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0562398978e501e8ee2caeb747a2852cc4a8c5fff250eb58e38f1c03217311" +checksum = "54b5362d7d072c72eec20581f67fc5400090c356a7f3ae77c79880b3b177b667" dependencies = [ "anyhow", "async-trait", @@ -3378,9 +3382,9 @@ dependencies = [ [[package]] name = "fuels" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921a8ea521744e600e0a34236adff7524ecf34bd940c2a018315d0212c140d7b" +checksum = "6ed08053e72bdb285d5a167c27a7a0d10f1dc4e27d1e6e5296dd2a67813bd13f" dependencies = [ "fuel-core-client", "fuel-crypto", @@ -3394,12 +3398,13 @@ dependencies = [ [[package]] name = "fuels-accounts" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da8bad87e947fc448c44c22e4c90a4af49d61de08722b1d1774d977b2071047" +checksum = "49fee90e8f3a4fc9392a6cde3010c561fa50da0f805d66fdb659eaa4d5d8a504" dependencies = [ "async-trait", "chrono", + "cynic", "elliptic-curve", "eth-keystore", "fuel-core-client", @@ -3419,9 +3424,9 @@ dependencies = [ [[package]] name = "fuels-code-gen" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fdc5f9dcdf330f5ef5f367dbc2334e72151e9ae46a4ee9f21d43a5e859be11b" +checksum = "f857b7ff658400506ca6be57bb84fedda44b566e78f5f0a8d0782242f41615c0" dependencies = [ "Inflector", "fuel-abi-types", @@ -3435,9 +3440,9 @@ dependencies = [ [[package]] name = "fuels-core" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629212e8278d57aa1a6f846ca0ca1e3428fb6da2d43e368931ff1494a0a6b5ce" +checksum = "baccbdd81e624f57950dcb136b32b853c520dd954badf26b9f58de33f3d71c7e" dependencies = [ "async-trait", "bech32", @@ -3457,15 +3462,16 @@ dependencies = [ "postcard", "serde", "serde_json", + "sha2 0.10.8", "thiserror", "uint", ] [[package]] name = "fuels-macros" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562bf012adedfb492431f4bfd5be4ccbf2171ab7d5247c5953a6be3ea8036072" +checksum = "5da75294c5e9da312bdc49239736699ee84ea9c5bfbc19a61a8ee588a1247aa1" dependencies = [ "fuels-code-gen", "itertools 0.12.1", @@ -3476,9 +3482,9 @@ dependencies = [ [[package]] name = "fuels-programs" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a366e6a78e1c104fe1cb14439199833987fe76ecd46ee2b46fe05868a3366d" +checksum = "32675ed1c08edd28ddb648dfae0c60a1946d4368a69ddfa6434f2316e33f0520" dependencies = [ "async-trait", "fuel-abi-types", @@ -3495,9 +3501,9 @@ dependencies = [ [[package]] name = "fuels-test-helpers" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7705708c0fe28a874c44635b77c3e120a3422c8a24fdc45f07dc8c21ee9ca6fb" +checksum = "02176c0fb1bf8cf58b8a9e5372efb650324740abcd4847b45bd0b041a0f133a2" dependencies = [ "fuel-core-chain-config", "fuel-core-client", diff --git a/Cargo.toml b/Cargo.toml index 69d4008bc12..2f335a5031b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,14 +86,14 @@ fuel-abi-types = "0.7" # Although ALL verions are "X.Y", we need the complete semver for # fuel-core-client as the GitHub Actions workflow parses this value to pull down # the correct tarball -fuel-core-client = { version = "0.37.0", default-features = false } -fuel-core-types = { version = "0.37", default-features = false } +fuel-core-client = { version = "0.40.0", default-features = false } +fuel-core-types = { version = "0.40", default-features = false } # Dependencies from the `fuels-rs` repository: -fuels = "0.66" -fuels-core = "0.66" -fuels-accounts = "0.66" +fuels = "0.66.9" +fuels-core = "0.66.9" +fuels-accounts = "0.66.9" # Dependencies from the `fuel-vm` repository: fuel-asm = "0.58" @@ -103,7 +103,7 @@ fuel-tx = "0.58" fuel-vm = "0.58" # Dependencies from the `forc-wallet` repository: -forc-wallet = "0.10" +forc-wallet = "0.11" # # External dependencies diff --git a/forc-plugins/forc-client/src/util/target.rs b/forc-plugins/forc-client/src/util/target.rs index 3982f91ce07..bbc5679e844 100644 --- a/forc-plugins/forc-client/src/util/target.rs +++ b/forc-plugins/forc-client/src/util/target.rs @@ -73,8 +73,8 @@ impl FromStr for Target { fn from_str(s: &str) -> Result { match s { - "testnet" => Ok(Target::Testnet), - "mainnet" => Ok(Target::Mainnet), + "Fuel Sepolia Testnet" => Ok(Target::Testnet), + "Ignition" => Ok(Target::Mainnet), "local" => Ok(Target::Local), _ => bail!( "'{s}' is not a valid target name. Possible values: '{}', '{}', '{}'", @@ -89,8 +89,8 @@ impl FromStr for Target { impl std::fmt::Display for Target { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let s = match self { - Target::Testnet => "testnet", - Target::Mainnet => "mainnet", + Target::Testnet => "Fuel Sepolia Testnet", + Target::Mainnet => "Ignition", Target::Local => "local", }; write!(f, "{}", s) diff --git a/forc-plugins/forc-client/src/util/tx.rs b/forc-plugins/forc-client/src/util/tx.rs index d1ceb751194..e9f8b220121 100644 --- a/forc-plugins/forc-client/src/util/tx.rs +++ b/forc-plugins/forc-client/src/util/tx.rs @@ -15,7 +15,9 @@ use forc_wallet::{ }; use fuel_crypto::SecretKey; use fuel_tx::{AssetId, ContractId}; -use fuels::{macros::abigen, programs::responses::CallResponse}; +use fuels::{ + macros::abigen, programs::responses::CallResponse, types::checksum_address::checksum_encode, +}; use fuels_accounts::{ provider::Provider, wallet::{Wallet, WalletUnlocked}, @@ -139,7 +141,7 @@ pub fn format_base_asset_account_balances( accounts_map: &AccountsMap, account_balances: &AccountBalances, base_asset_id: &AssetId, -) -> Vec { +) -> Result> { accounts_map .iter() .zip(account_balances) @@ -148,10 +150,12 @@ pub fn format_base_asset_account_balances( .get(&base_asset_id.to_string()) .copied() .unwrap_or(0); + let raw_addr = format!("0x{address}"); + let checksum_addr = checksum_encode(&raw_addr)?; let eth_amount = base_asset_amount as f64 / 1_000_000_000.0; - format!("[{ix}] {address} - {eth_amount} ETH") + Ok(format!("[{ix}] {checksum_addr} - {eth_amount} ETH")) }) - .collect() + .collect::>>() } // TODO: Simplify the function signature once https://github.com/FuelLabs/sway/issues/6071 is closed. @@ -196,7 +200,7 @@ pub(crate) async fn select_account( anyhow::bail!(message) } let selections = - format_base_asset_account_balances(&accounts, &account_balances, base_asset_id); + format_base_asset_account_balances(&accounts, &account_balances, base_asset_id)?; let mut account_index; loop { @@ -210,7 +214,14 @@ pub(crate) async fn select_account( if accounts.contains_key(&account_index) { break; } - let options: Vec = accounts.keys().map(|key| key.to_string()).collect(); + let options: Vec = accounts + .keys() + .map(|key| { + let raw_addr = format!("0x{key}"); + let checksum_addr = checksum_encode(&raw_addr)?; + Ok(checksum_addr) + }) + .collect::>>()?; println_warning(&format!( "\"{}\" is not a valid account.\nPlease choose a valid option from {}", account_index, @@ -287,6 +298,7 @@ mod tests { ) .expect("address1") .into(); + let address2: fuel_tx::Address = Bech32Address::from_str( "fuel1x9f3ysyk7fmey5ac23s2p4rwg4gjye2kke3nu3pvrs5p4qc4m4qqwx56k3", ) @@ -308,13 +320,18 @@ mod tests { balance2.insert("other_asset".to_string(), 3_000_000_000); account_balances.push(balance2); + let address1_expected = + "0x6B32DF5954e1BaDEAFFEFD2c0fc5E594dcff3713aaE3Dd18B7d966624B010027"; + let address2_expected = + "0x3153124096f2779253B85460a0D46e4551226556b6633E442c1C281a8315dd40"; let expected = vec![ - format!("[0] {address1} - 1.5 ETH"), - format!("[1] {address2} - 0 ETH"), + format!("[0] {address1_expected} - 1.5 ETH"), + format!("[1] {address2_expected} - 0 ETH"), ]; let result = - format_base_asset_account_balances(&accounts_map, &account_balances, &base_asset_id); + format_base_asset_account_balances(&accounts_map, &account_balances, &base_asset_id) + .unwrap(); assert_eq!(result, expected); } } diff --git a/test/src/sdk-harness/Cargo.lock b/test/src/sdk-harness/Cargo.lock index a6bed9abb7b..dad11fa0e14 100644 --- a/test/src/sdk-harness/Cargo.lock +++ b/test/src/sdk-harness/Cargo.lock @@ -449,7 +449,7 @@ dependencies = [ "sync_wrapper", "tokio", "tower", - "tower-http", + "tower-http 0.3.5", "tower-layer", "tower-service", ] @@ -1646,6 +1646,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "float-cmp" version = "0.9.0" @@ -1707,35 +1713,36 @@ dependencies = [ [[package]] name = "fuel-asm" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79ca07227658105bdf873556dea09fa7fbfe792fbc084b4b9568f5ba3d64c411" +checksum = "5f325971bf9047ec70004f80a989e03456316bc19cbef3ff3a39a38b192ab56e" dependencies = [ "bitflags 2.5.0", - "fuel-types 0.58.0", + "fuel-types 0.58.2", "serde", "strum 0.24.1", ] [[package]] name = "fuel-compression" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3af97bfc2c2b4f0a7f471141663557f13462d7ac278922b01ebaf2127e7515f3" +checksum = "24e42841f56f76ed759b3f516e5188d5c42de47015bee951651660c13b6dfa6c" dependencies = [ - "fuel-derive 0.58.0", - "fuel-types 0.58.0", + "fuel-derive 0.58.2", + "fuel-types 0.58.2", "serde", ] [[package]] name = "fuel-core" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8bc5d6df88c21c821bf56dfa0bbd148c18b5153551c4119e5497ab7b90b3d22" +checksum = "9d5873aa1178f6fafdd967ddee2214a78be8be0c612a9c695889d31b5c1ede44" dependencies = [ "anyhow", "async-graphql", + "async-graphql-value", "async-trait", "axum", "clap", @@ -1755,7 +1762,7 @@ dependencies = [ "fuel-core-services", "fuel-core-storage", "fuel-core-txpool", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "fuel-core-upgradable-executor", "futures", "hex", @@ -1773,22 +1780,23 @@ dependencies = [ "tokio-rayon", "tokio-stream", "tokio-util", - "tower-http", + "tower", + "tower-http 0.4.4", "tracing", "uuid 1.8.0", ] [[package]] name = "fuel-core-chain-config" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd1eca1d12daf8ad0f2479d7fff9405d94b6467496e5319e5f8b99cbdabdd58b" +checksum = "990db3029efd3766c4ae7c92a53c159ae66abf6f568ac6a3d58354f11400e6e2" dependencies = [ "anyhow", "bech32", "derivative", "fuel-core-storage", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "itertools 0.12.1", "postcard", "rand", @@ -1800,16 +1808,16 @@ dependencies = [ [[package]] name = "fuel-core-client" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbd88f285afdf061e409b712ecef49e2fe9ba235288cc76e8de8f05d50b6876" +checksum = "f09b3a35e82226d77b10653829beb508dc4bcf698fbdaa96610faf894e794444" dependencies = [ "anyhow", "base64 0.22.1", "cynic", "derive_more", "eventsource-client", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "futures", "hex", "hyper-rustls", @@ -1825,12 +1833,12 @@ dependencies = [ [[package]] name = "fuel-core-compression" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fdfc8202216391d0dfc87922eaf2576100c618ed67a8244212ca58dd1b2171" +checksum = "0b6ed44f8fcd0f1ff5983510e49835149b39afb8226257f6397db17a0ca0558d" dependencies = [ "anyhow", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "paste", "rand", "serde", @@ -1840,38 +1848,38 @@ dependencies = [ [[package]] name = "fuel-core-consensus-module" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a95b4d2df8d8099839f3f3c00429c1af5271783d24007481711c37f579bfd4da" +checksum = "61161b1016ffb1a4f0d629534dd0b165bdaf146ce5037ccd5c8e8c9ec740d52f" dependencies = [ "anyhow", "fuel-core-chain-config", "fuel-core-poa", "fuel-core-storage", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", ] [[package]] name = "fuel-core-database" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b466baa45ea41ca9141b3e4ff2b5387f10d274f484561755f9b0d9c953892083" +checksum = "ceae011a49cbccb0e9b043c67f7e64dfd2f4d41233de34aff11d23646e98f5d8" dependencies = [ "anyhow", "derive_more", "fuel-core-storage", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", ] [[package]] name = "fuel-core-executor" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71858c962367af3c3e5c651c2ea62f1d268d7bc77e6326cd4a206d74a58d0dec" +checksum = "db57f06af045fafa81b76ca11318d47579e41babb0839fb0955ae7cf32e58a1f" dependencies = [ "anyhow", "fuel-core-storage", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "hex", "parking_lot", "serde", @@ -1880,19 +1888,20 @@ dependencies = [ [[package]] name = "fuel-core-gas-price-service" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33755cb67a3892c5dd058b0f2c022d0f16adebf6bb29a94814794044fbb6a67" +checksum = "eea974f842be1ca7783df7eec770b5865c3babd50a10a5d8f107bdac65419c45" dependencies = [ "anyhow", "async-trait", "enum-iterator", "fuel-core-services", "fuel-core-storage", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "fuel-gas-price-algorithm", "futures", "num_enum", + "parking_lot", "reqwest", "serde", "strum 0.25.0", @@ -1905,15 +1914,15 @@ dependencies = [ [[package]] name = "fuel-core-importer" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc8cea1fabe1a51bdabce436d7040d29b3a4d14c0429289060d0a754a1b1a46" +checksum = "2a6a75d87da09380dc6f706ec0eb4171cb1309fef6a4c8b709025769a1903235" dependencies = [ "anyhow", "derive_more", "fuel-core-metrics", "fuel-core-storage", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "parking_lot", "rayon", "tokio", @@ -1922,22 +1931,25 @@ dependencies = [ [[package]] name = "fuel-core-metrics" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc199e165e600f241cab86129766b26bab78572a701a39bc40a5fdb669961a8" +checksum = "94a1c3eb92040d95d27f7c658801bb5c04ad4aaf67de380cececbeed5aab6e61" dependencies = [ + "once_cell", "parking_lot", "pin-project-lite", "prometheus-client", "regex", + "strum 0.25.0", + "strum_macros 0.25.3", "tracing", ] [[package]] name = "fuel-core-p2p" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ae4fa0826f148c13248db4fe634d2ba7a297bbd424e7288c6e1d881a50f662" +checksum = "db5c996b4d392a5f1991b4d2fcc2fe570dc846f8a763a30105cd7b3c8d08e747" dependencies = [ "anyhow", "async-trait", @@ -1945,7 +1957,7 @@ dependencies = [ "fuel-core-metrics", "fuel-core-services", "fuel-core-storage", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "futures", "hex", "hickory-resolver", @@ -1969,16 +1981,16 @@ dependencies = [ [[package]] name = "fuel-core-poa" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49c4f3e5fa1e916793609bdb9a52142077a84a793272379a04cf24375aa94e6f" +checksum = "2f6f78fa31dc56b9458e3ca9a7058b4bea381e16e49fcab0db49923be8a30f9c" dependencies = [ "anyhow", "async-trait", "fuel-core-chain-config", "fuel-core-services", "fuel-core-storage", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "serde", "serde_json", "tokio", @@ -1988,15 +2000,15 @@ dependencies = [ [[package]] name = "fuel-core-producer" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642d4a10f1df444a09944ae547f1782ca865ac4705ea9cefe0821c5a8e4b3081" +checksum = "7739b2019df5b9d5042ba2d9f7036c6feee105a0e441d8bcfd933221da5be635" dependencies = [ "anyhow", "async-trait", "derive_more", "fuel-core-storage", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "tokio", "tokio-rayon", "tracing", @@ -2004,30 +2016,32 @@ dependencies = [ [[package]] name = "fuel-core-services" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "739dca83db1eb86651db3833f088f52afcd3f181cfca40e5725074aceb3ea49d" +checksum = "8312b598da4b9a6503c9263c1c2a7ea58d34ab1f86e7f345490e12d309fb29bb" dependencies = [ "anyhow", "async-trait", "fuel-core-metrics", "futures", "parking_lot", + "pin-project-lite", + "rayon", "tokio", "tracing", ] [[package]] name = "fuel-core-storage" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6255d852b6866199d103233e1eef2e7ded141019bc782b5b211fcf001727c34b" +checksum = "bda9242ebc9e8ef3251b9eae85f4ce5cdb376348baa30925606f3ce602db7ec5" dependencies = [ "anyhow", "derive_more", "enum-iterator", - "fuel-core-types 0.37.0", - "fuel-vm 0.58.0", + "fuel-core-types 0.40.0", + "fuel-vm 0.58.2", "impl-tools", "itertools 0.12.1", "mockall", @@ -2043,24 +2057,21 @@ dependencies = [ [[package]] name = "fuel-core-txpool" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7b4667213fa8aca461f49c9b305f1f2abda2848a2da5323999d82e3dc76a723" +checksum = "34cde90da8d814046018c5341129bffdbc51e6721e69ada9a393b3d4c16be14b" dependencies = [ "anyhow", "async-trait", "derive_more", - "fuel-core-metrics", "fuel-core-services", "fuel-core-storage", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "futures", - "mockall", "num-rational", "parking_lot", - "rayon", + "petgraph", "tokio", - "tokio-rayon", "tokio-stream", "tracing", ] @@ -2083,15 +2094,15 @@ dependencies = [ [[package]] name = "fuel-core-types" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a4e9b2de06381e1ad598cd1030344993fee7401331ca9955d0a1860cc0484c" +checksum = "6ee3a95b189bf729d21354a761862bb481298cbd883550adc3fef1bc7beb0b67" dependencies = [ "anyhow", "bs58", "derivative", "derive_more", - "fuel-vm 0.58.0", + "fuel-vm 0.58.2", "rand", "secrecy", "serde", @@ -2101,15 +2112,15 @@ dependencies = [ [[package]] name = "fuel-core-upgradable-executor" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "768bf8bbb7d27d13b5055ad7b755609e027b5a322b3b21790fac7a478685ba14" +checksum = "620b671cd011ee14c846628ca0d913b770923b36fd87d44dd7ba70f1a8db0eec" dependencies = [ "anyhow", "derive_more", "fuel-core-executor", "fuel-core-storage", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "fuel-core-wasm-executor", "parking_lot", "postcard", @@ -2119,15 +2130,15 @@ dependencies = [ [[package]] name = "fuel-core-wasm-executor" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385ce8e704a7370ec5230ba3bd7d986cbe66174f400160b54cf76799a578609e" +checksum = "b44366541d35be9ea11ed88ed54629c64e91c309ca5fbf861fd909d443ca7575" dependencies = [ "anyhow", "fuel-core-executor", "fuel-core-storage", "fuel-core-types 0.35.0", - "fuel-core-types 0.37.0", + "fuel-core-types 0.40.0", "postcard", "serde", "serde_json", @@ -2151,15 +2162,15 @@ dependencies = [ [[package]] name = "fuel-crypto" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f53b06525aa7754bf7c3ef23daf15fd798ae990a82f8b7b813d25cedfeacfe5c" +checksum = "65e318850ca64890ff123a99b6b866954ef49da94ab9bc6827cf6ee045568585" dependencies = [ "coins-bip32", "coins-bip39", "ecdsa", "ed25519-dalek", - "fuel-types 0.58.0", + "fuel-types 0.58.2", "k256", "lazy_static", "p256", @@ -2184,9 +2195,9 @@ dependencies = [ [[package]] name = "fuel-derive" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e34d6eec30d04506607cc0bc85fc97c57c964580cd233fd557e346c5273535" +checksum = "ab0bc46a3552964bae5169e79b383761a54bd115ea66951a1a7a229edcefa55a" dependencies = [ "proc-macro2", "quote", @@ -2196,9 +2207,9 @@ dependencies = [ [[package]] name = "fuel-gas-price-algorithm" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d4a5847c09db9159ea66bc75bdfe59c4d6139d8b24c1a8026f253f011409bc" +checksum = "7b51715a07bb4a099ca4c658796c7a732f3edb3dfb2cec3407769081c949dc0b" dependencies = [ "serde", "thiserror", @@ -2221,13 +2232,13 @@ dependencies = [ [[package]] name = "fuel-merkle" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9fa3708405eba32fd2b947b827dc52484377ba6a238260b03a07b642395e6c" +checksum = "c79eca6a452311c70978a5df796c0f99f27e474b69719e0db4c1d82e68800d07" dependencies = [ "derive_more", "digest 0.10.7", - "fuel-storage 0.58.0", + "fuel-storage 0.58.2", "hashbrown 0.13.2", "hex", "serde", @@ -2242,9 +2253,9 @@ checksum = "4c1b711f28553ddc5f3546711bd220e144ce4c1af7d9e9a1f70b2f20d9f5b791" [[package]] name = "fuel-storage" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f678f1c900d0632d77e15d4a4946048d4d517fefeba72607390c03288ca127" +checksum = "2d0c46b5d76b3e11197bd31e036cd8b1cb46c4d822cacc48836638080c6d2b76" [[package]] name = "fuel-tx" @@ -2270,18 +2281,18 @@ dependencies = [ [[package]] name = "fuel-tx" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e3065c12eecc9121514694f4b01009c9a83d8842af11c43ec9e2bbc0a7f36cb" +checksum = "6723bb8710ba2b70516ac94d34459593225870c937670fb3afaf82e0354667ac" dependencies = [ "bitflags 2.5.0", "derivative", "derive_more", - "fuel-asm 0.58.0", + "fuel-asm 0.58.2", "fuel-compression", - "fuel-crypto 0.58.0", - "fuel-merkle 0.58.0", - "fuel-types 0.58.0", + "fuel-crypto 0.58.2", + "fuel-merkle 0.58.2", + "fuel-types 0.58.2", "hashbrown 0.14.5", "itertools 0.10.5", "postcard", @@ -2304,11 +2315,11 @@ dependencies = [ [[package]] name = "fuel-types" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a93d5f3fd028d874d8927be439fcdea01cb04499049bc68a874c73dd0c7e32b7" +checksum = "982265415a99b5bd6277bc24194a233bb2e18764df11c937b3dbb11a02c9e545" dependencies = [ - "fuel-derive 0.58.0", + "fuel-derive 0.58.2", "hex", "rand", "serde", @@ -2347,9 +2358,9 @@ dependencies = [ [[package]] name = "fuel-vm" -version = "0.58.0" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0562398978e501e8ee2caeb747a2852cc4a8c5fff250eb58e38f1c03217311" +checksum = "54b5362d7d072c72eec20581f67fc5400090c356a7f3ae77c79880b3b177b667" dependencies = [ "anyhow", "async-trait", @@ -2358,13 +2369,13 @@ dependencies = [ "derivative", "derive_more", "ethnum", - "fuel-asm 0.58.0", + "fuel-asm 0.58.2", "fuel-compression", - "fuel-crypto 0.58.0", - "fuel-merkle 0.58.0", - "fuel-storage 0.58.0", - "fuel-tx 0.58.0", - "fuel-types 0.58.0", + "fuel-crypto 0.58.2", + "fuel-merkle 0.58.2", + "fuel-storage 0.58.2", + "fuel-tx 0.58.2", + "fuel-types 0.58.2", "hashbrown 0.14.5", "itertools 0.10.5", "libm", @@ -2382,13 +2393,13 @@ dependencies = [ [[package]] name = "fuels" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921a8ea521744e600e0a34236adff7524ecf34bd940c2a018315d0212c140d7b" +checksum = "6ed08053e72bdb285d5a167c27a7a0d10f1dc4e27d1e6e5296dd2a67813bd13f" dependencies = [ "fuel-core-client", - "fuel-crypto 0.58.0", - "fuel-tx 0.58.0", + "fuel-crypto 0.58.2", + "fuel-tx 0.58.2", "fuels-accounts", "fuels-core", "fuels-macros", @@ -2398,19 +2409,20 @@ dependencies = [ [[package]] name = "fuels-accounts" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da8bad87e947fc448c44c22e4c90a4af49d61de08722b1d1774d977b2071047" +checksum = "49fee90e8f3a4fc9392a6cde3010c561fa50da0f805d66fdb659eaa4d5d8a504" dependencies = [ "async-trait", "chrono", + "cynic", "elliptic-curve", "eth-keystore", "fuel-core-client", - "fuel-core-types 0.37.0", - "fuel-crypto 0.58.0", - "fuel-tx 0.58.0", - "fuel-types 0.58.0", + "fuel-core-types 0.40.0", + "fuel-crypto 0.58.2", + "fuel-tx 0.58.2", + "fuel-types 0.58.2", "fuels-core", "itertools 0.12.1", "rand", @@ -2423,9 +2435,9 @@ dependencies = [ [[package]] name = "fuels-code-gen" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fdc5f9dcdf330f5ef5f367dbc2334e72151e9ae46a4ee9f21d43a5e859be11b" +checksum = "f857b7ff658400506ca6be57bb84fedda44b566e78f5f0a8d0782242f41615c0" dependencies = [ "Inflector", "fuel-abi-types", @@ -2439,37 +2451,38 @@ dependencies = [ [[package]] name = "fuels-core" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629212e8278d57aa1a6f846ca0ca1e3428fb6da2d43e368931ff1494a0a6b5ce" +checksum = "baccbdd81e624f57950dcb136b32b853c520dd954badf26b9f58de33f3d71c7e" dependencies = [ "async-trait", "bech32", "chrono", "fuel-abi-types", - "fuel-asm 0.58.0", + "fuel-asm 0.58.2", "fuel-core-chain-config", "fuel-core-client", - "fuel-core-types 0.37.0", - "fuel-crypto 0.58.0", - "fuel-tx 0.58.0", - "fuel-types 0.58.0", - "fuel-vm 0.58.0", + "fuel-core-types 0.40.0", + "fuel-crypto 0.58.2", + "fuel-tx 0.58.2", + "fuel-types 0.58.2", + "fuel-vm 0.58.2", "fuels-macros", "hex", "itertools 0.12.1", "postcard", "serde", "serde_json", + "sha2 0.10.8", "thiserror", "uint", ] [[package]] name = "fuels-macros" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562bf012adedfb492431f4bfd5be4ccbf2171ab7d5247c5953a6be3ea8036072" +checksum = "5da75294c5e9da312bdc49239736699ee84ea9c5bfbc19a61a8ee588a1247aa1" dependencies = [ "fuels-code-gen", "itertools 0.12.1", @@ -2480,15 +2493,15 @@ dependencies = [ [[package]] name = "fuels-programs" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a366e6a78e1c104fe1cb14439199833987fe76ecd46ee2b46fe05868a3366d" +checksum = "32675ed1c08edd28ddb648dfae0c60a1946d4368a69ddfa6434f2316e33f0520" dependencies = [ "async-trait", "fuel-abi-types", - "fuel-asm 0.58.0", - "fuel-tx 0.58.0", - "fuel-types 0.58.0", + "fuel-asm 0.58.2", + "fuel-tx 0.58.2", + "fuel-types 0.58.2", "fuels-accounts", "fuels-core", "itertools 0.12.1", @@ -2499,19 +2512,19 @@ dependencies = [ [[package]] name = "fuels-test-helpers" -version = "0.66.6" +version = "0.66.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7705708c0fe28a874c44635b77c3e120a3422c8a24fdc45f07dc8c21ee9ca6fb" +checksum = "02176c0fb1bf8cf58b8a9e5372efb650324740abcd4847b45bd0b041a0f133a2" dependencies = [ "fuel-core", "fuel-core-chain-config", "fuel-core-client", "fuel-core-poa", "fuel-core-services", - "fuel-core-types 0.37.0", - "fuel-crypto 0.58.0", - "fuel-tx 0.58.0", - "fuel-types 0.58.0", + "fuel-core-types 0.40.0", + "fuel-crypto 0.58.2", + "fuel-tx 0.58.2", + "fuel-types 0.58.2", "fuels-accounts", "fuels-core", "futures", @@ -4398,6 +4411,16 @@ dependencies = [ "ucd-trie", ] +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.2.6", +] + [[package]] name = "pin-project" version = "1.1.5" @@ -5735,7 +5758,7 @@ dependencies = [ "assert_matches", "fuel-core", "fuel-core-client", - "fuel-vm 0.58.0", + "fuel-vm 0.58.2", "fuels", "hex", "paste", @@ -5954,6 +5977,7 @@ dependencies = [ "pin-project", "pin-project-lite", "tokio", + "tokio-util", "tower-layer", "tower-service", "tracing", @@ -5973,10 +5997,28 @@ dependencies = [ "http-body", "http-range-header", "pin-project-lite", - "tokio", "tower", "tower-layer", "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +dependencies = [ + "bitflags 2.5.0", + "bytes", + "futures-core", + "futures-util", + "http 0.2.12", + "http-body", + "http-range-header", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", "tracing", ] diff --git a/test/src/sdk-harness/Cargo.toml b/test/src/sdk-harness/Cargo.toml index 778acf33105..3d28c7b1506 100644 --- a/test/src/sdk-harness/Cargo.toml +++ b/test/src/sdk-harness/Cargo.toml @@ -10,15 +10,15 @@ publish = false assert_matches = "1.5" # Dependencies from the `fuel-core` repository: -fuel-core = { version = "0.37", default-features = false } +fuel-core = { version = "0.40", default-features = false } # Using full semver as the workspace Cargo.toml (see the comment there) -fuel-core-client = { version = "0.37.0", default-features = false } +fuel-core-client = { version = "0.40.0", default-features = false } # Dependencies from the `fuel-vm` repository: fuel-vm = { version = "0.58", features = ["random"] } # Dependencies from the `fuels-rs` repository: -fuels = { version = "0.66.6", features = ["fuel-core-lib"] } +fuels = { version = "0.66.9", features = ["fuel-core-lib"] } hex = "0.4" paste = "1.0"