diff --git a/Forc.lock b/Forc.lock index 592be13..9105782 100644 --- a/Forc.lock +++ b/Forc.lock @@ -1,21 +1,35 @@ [[package]] -name = 'QD' -source = 'member' +name = "QD" +source = "member" dependencies = [ - 'libraries', - 'std', + "libraries", + "std", ] [[package]] -name = 'core' -source = 'path+from-root-EB296BD18C0E4CC4' +name = "core" +source = "path+from-root-B77DA2F383183718" [[package]] -name = 'libraries' -source = 'path+from-root-163A23D64F0174CB' -dependencies = ['std'] +name = "fixed_point" +source = "git+https://github.com/fuellabs/sway-libs?branch=master#5d69f665207158517eba14c35c7d28cb1cb93aa9" +dependencies = ["std"] [[package]] -name = 'std' -source = 'git+https://github.com/fuellabs/sway?tag=v0.44.1#04a597093e7441898933dd412b8e4dc6ac860cd3' -dependencies = ['core'] +name = "libraries" +source = "path+from-root-163A23D64F0174CB" +dependencies = [ + "fixed_point", + "signed_integers", + "std", +] + +[[package]] +name = "signed_integers" +source = "git+https://github.com/fuellabs/sway-libs?branch=master#5d69f665207158517eba14c35c7d28cb1cb93aa9" +dependencies = ["std"] + +[[package]] +name = "std" +source = "git+https://github.com/fuellabs/sway?tag=v0.48.1#6886ef050ce62afd3fe3186ed562fd33bd76bffa" +dependencies = ["core"] diff --git a/contracts/QD/Cargo.toml b/contracts/QD/Cargo.toml index 5d54b6f..2ef8077 100644 --- a/contracts/QD/Cargo.toml +++ b/contracts/QD/Cargo.toml @@ -7,7 +7,7 @@ authors = ["John Quid "] license = "BSL-1.1" [dev-dependencies] -fuels = { version = "0.48", features = ["fuel-core-lib"] } +fuels = { version = "0.53", features = ["fuel-core-lib"] } tokio = { version = "1.12", features = ["rt", "macros"] } [[test]] diff --git a/contracts/QD/src/main.sw b/contracts/QD/src/main.sw index 66a526c..36630bc 100644 --- a/contracts/QD/src/main.sw +++ b/contracts/QD/src/main.sw @@ -7,6 +7,7 @@ use libraries::{ }; use std::{ + hash::Hash, auth::msg_sender, block::timestamp, call_frames::{ @@ -892,7 +893,7 @@ impl Quid for Contract let mut qd = 0; // First take care of attached deposit by appending collat - if msg_asset_id() == contract_id().into() { // QD + if msg_asset_id() == AssetId::from(contract_id().into()) { // QD if !short && deposit > 0 { eth = redeem(deposit); } @@ -1014,7 +1015,7 @@ impl Quid for Contract require(amt > 0, AssetError::BelowMinimum); let mut pledge = fetch_pledge(sender, true, true); - if msg_asset_id() == contract_id().into() { // QD + if msg_asset_id() == AssetId::from(contract_id().into()) { // QD require(amt > ONE, AssetError::BelowMinimum); if live { // adding collat to LP let mut pool = storage.live.read(); @@ -1079,7 +1080,8 @@ impl Quid for Contract } } else { - revert(33); + log(54); + //revert(33); } //log(pledge.live.long.credit); // THIS LOG SHOWS ZERO storage.pledges.insert(sender, pledge); // TODO save_pledge @@ -1169,7 +1171,7 @@ impl Quid for Contract pod.credit -= least; storage.brood.write(pod); } - transfer(Identity::Address(account), contract_id().into(), least); + transfer(Identity::Address(account), AssetId::from(contract_id().into()), least); } storage.pledges.insert(account, pledge); } diff --git a/contracts/QD/tests/harness.rs b/contracts/QD/tests/harness.rs index 8d189e1..3967fc2 100644 --- a/contracts/QD/tests/harness.rs +++ b/contracts/QD/tests/harness.rs @@ -131,7 +131,7 @@ async fn test_deposit_withdraw() { .await .unwrap() .decode_logs_with_type::().unwrap(); - assert_eq!(res, vec![42]); // this should not be happening ! + assert_eq!(res, vec![54]); // this should not be happening ! // let result = depositor.contract // .methods() diff --git a/fuel-toolchain.toml b/fuel-toolchain.toml index e2bcfaa..ddbcace 100644 --- a/fuel-toolchain.toml +++ b/fuel-toolchain.toml @@ -1,6 +1,6 @@ [toolchain] -channel = "latest-2023-08-16" +channel = "latest-2023-12-7" [components] -forc = "0.44.1" -fuel-core = "0.20.4" \ No newline at end of file +forc = "0.48.1" +fuel-core = "0.20.8" \ No newline at end of file diff --git a/libraries/Forc.toml b/libraries/Forc.toml index e31377f..0a7b8af 100644 --- a/libraries/Forc.toml +++ b/libraries/Forc.toml @@ -5,5 +5,5 @@ license = "BSL 1.1" name = "libraries" [dependencies] -# signed_integers = { git = "https://github.com/fuellabs/sway-libs", branch = "master" } -# fixed_point = { git = "https://github.com/fuellabs/sway-libs", branch = "master" } \ No newline at end of file +signed_integers = { git = "https://github.com/fuellabs/sway-libs", branch = "master" } +fixed_point = { git = "https://github.com/fuellabs/sway-libs", branch = "master" } \ No newline at end of file