Skip to content

Commit

Permalink
Bump to fuels 0.30 and fuel-core 0.14 (FuelLabs#3304)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadfawaz authored Nov 6, 2022
1 parent 852bef4 commit dff5e4f
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ jobs:
runs-on: ubuntu-latest
services:
fuel-core:
image: ghcr.io/fuellabs/fuel-core:v0.13.2
image: ghcr.io/fuellabs/fuel-core:v0.14.0
ports:
- 4000:4000
steps:
Expand Down
24 changes: 13 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions forc-plugins/forc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ clap = { version = "3", features = ["derive", "env"] }
forc-pkg = { version = "0.30.1", path = "../../forc-pkg" }
forc-tracing = { version = "0.30.1", path = "../../forc-tracing" }
forc-util = { version = "0.30.1", path = "../../forc-util" }
fuel-gql-client = { version = "0.13", default-features = false }
fuel-gql-client = { version = "0.14", default-features = false }
fuel-tx = { version = "0.23", features = ["builder"] }
fuels-core = "0.28"
fuels-signers = "0.28"
fuels-types = "0.28"
fuels-core = "0.30"
fuels-signers = "0.30"
fuels-types = "0.30"
futures = "0.3"
hex = "0.4.3"
serde = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion forc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ forc-test = { version = "0.30.1", path = "../forc-test" }
forc-tracing = { version = "0.30.1", path = "../forc-tracing" }
forc-util = { version = "0.30.1", path = "../forc-util" }
fs_extra = "1.2"
fuel-asm = "0.9"
fuel-asm = "0.10"
hex = "0.4.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.73"
Expand Down
2 changes: 1 addition & 1 deletion templates/sway-test-rs/template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = ["{{authors}}"]
license = "Apache-2.0"

[dev-dependencies]
fuels = { version = "0.28", features = ["fuel-core-lib"] }
fuels = { version = "0.30", features = ["fuel-core-lib"] }
tokio = { version = "1.12", features = ["rt", "macros"] }

[[test]]
Expand Down
1 change: 1 addition & 0 deletions templates/sway-test-rs/template/tests/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ async fn get_contract_instance() -> (MyContract, ContractId) {
Some(1_000_000_000), /* Amount per coin */
),
None,
None,
)
.await;
let wallet = wallets.pop().unwrap();
Expand Down
7 changes: 4 additions & 3 deletions test/src/sdk-harness/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ version = "0.0.0"

[dependencies]
assert_matches = "1.5.0"
fuel-core = { version = "0.13", default-features = false }
fuel-gql-client = { version = "0.13", default-features = false }
fuel-core = { version = "0.14", default-features = false }
fuel-gql-client = { version = "0.14", default-features = false }
fuel-types = "0.5"
fuel-vm = "0.22"
fuels = { version = "0.28", features = ["fuel-core-lib"] }
fuels = { version = "0.30", features = ["fuel-core-lib"] }
hex = "0.4.3"
rand = "0.8"
sha2 = "0.10"
sha3 = "0.10.1"
tai64 = {version = "4.0", features = ["serde"] }
tokio = { version = "1.12", features = ["rt", "macros"] }

[[test]]
Expand Down
15 changes: 7 additions & 8 deletions test/src/sdk-harness/test_projects/block/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use fuels::prelude::*;
use std::time::{SystemTime, UNIX_EPOCH};
use tai64::Tai64;
use tokio::time::{sleep, Duration};

abigen!(
Expand Down Expand Up @@ -41,13 +42,11 @@ async fn can_get_block_height() {
async fn can_get_timestamp() {
let (instance, _id) = get_block_instance().await;
let block_0_time = instance.methods().get_timestamp().call().await.unwrap();
let now = SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("Time went backwards");
let now = Tai64::now();

// This should really be zero in most cases, but be conservative to guarantee the stability of
// the test
assert!(now.as_millis() as u64 - block_0_time.value <= 1000);
assert!(now.0 - block_0_time.value <= 1);

// Wait 1 seconds and request another block
sleep(Duration::from_secs(1)).await;
Expand All @@ -56,8 +55,8 @@ async fn can_get_timestamp() {
// The difference should be 1 second in most cases, but be conservative to guarantee the
// stability of the test
assert!(
1000 <= block_1_time.value - block_0_time.value
&& block_1_time.value - block_0_time.value <= 2000
1 <= block_1_time.value - block_0_time.value
&& block_1_time.value - block_0_time.value <= 2
);
// Wait 2 seconds and request another block
sleep(Duration::from_secs(2)).await;
Expand All @@ -66,8 +65,8 @@ async fn can_get_timestamp() {
// The difference should be 2 seconds in most cases, but be conservative to guarantee the
// stability of the test
assert!(
2000 <= block_2_time.value - block_1_time.value
&& block_2_time.value - block_1_time.value <= 3000
2 <= block_2_time.value - block_1_time.value
&& block_2_time.value - block_1_time.value <= 3
);
}

Expand Down
2 changes: 1 addition & 1 deletion test/src/sdk-harness/test_projects/ec_recover/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async fn setup_env() -> Result<
coins_per_asset,
amount_per_coin,
);
let (provider, _socket_addr) = setup_test_provider(coins.clone(), vec![], None).await;
let (provider, _socket_addr) = setup_test_provider(coins.clone(), vec![], None, None).await;
wallet.set_provider(provider);

let contract_id = Contract::deploy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ async fn ec_recover_and_match_predicate_test() -> Result<(), Error> {
utxo_validation: true,
..Config::local_node()
}),
None,
)
.await;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ async fn setup() -> (Vec<u8>, Address, WalletUnlocked, u64, AssetId) {
utxo_validation: true,
..Config::local_node()
}),
None,
)
.await;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ async fn setup() -> (Vec<u8>, Address, WalletUnlocked, u64, AssetId) {
utxo_validation: true,
..Config::local_node()
}),
None,
)
.await;

Expand Down
8 changes: 4 additions & 4 deletions test/src/sdk-harness/test_projects/token_ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ async fn can_perform_generic_mint_to_with_contract_id() {
Some(amount_per_coin),
);

let wallets = launch_custom_provider_and_get_wallets(config, None).await;
let wallets = launch_custom_provider_and_get_wallets(config, None, None).await;
let (fuelcoin_instance, fuelcoin_id) = get_fuelcoin_instance(wallets[0].clone()).await;
let balance_id = get_balance_contract_id(wallets[0].clone()).await;
let amount = 55u64;
Expand Down Expand Up @@ -318,7 +318,7 @@ async fn can_perform_generic_transfer_to_contract() {
Some(coins_per_wallet),
Some(amount_per_coin),
);
let wallets = launch_custom_provider_and_get_wallets(config, None).await;
let wallets = launch_custom_provider_and_get_wallets(config, None, None).await;

let (fuelcoin_instance, fuelcoin_id) = get_fuelcoin_instance(wallets[0].clone()).await;
let balance_id = get_balance_contract_id(wallets[0].clone()).await;
Expand Down Expand Up @@ -364,7 +364,7 @@ async fn can_send_message_output_with_data() {
Some(amount_per_coin),
);

let wallets = launch_custom_provider_and_get_wallets(config, None).await;
let wallets = launch_custom_provider_and_get_wallets(config, None, None).await;
let (fuelcoin_instance, fuelcoin_id) = get_fuelcoin_instance(wallets[0].clone()).await;

let amount = 33u64;
Expand Down Expand Up @@ -406,7 +406,7 @@ async fn can_send_message_output_without_data() {
Some(amount_per_coin),
);

let wallets = launch_custom_provider_and_get_wallets(config, None).await;
let wallets = launch_custom_provider_and_get_wallets(config, None, None).await;
let (fuelcoin_instance, fuelcoin_id) = get_fuelcoin_instance(wallets[0].clone()).await;

let amount = 33u64;
Expand Down

0 comments on commit dff5e4f

Please sign in to comment.