From a06e5bf8e16b2026c52307fe6d7ec43ce8bd272b Mon Sep 17 00:00:00 2001 From: Jackliu-miaozi <71253778+Jackliu-miaozi@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:48:32 +0800 Subject: [PATCH 1/6] Initial commit --- contracts/01-tamagotchi/io/src/lib.rs | 15 +++++++---- contracts/01-tamagotchi/src/lib.rs | 30 ++++++++++++++++++++-- contracts/01-tamagotchi/tests/smoke.rs | 35 +++++++++++++++++++++++--- 3 files changed, 70 insertions(+), 10 deletions(-) diff --git a/contracts/01-tamagotchi/io/src/lib.rs b/contracts/01-tamagotchi/io/src/lib.rs index 394f418f..512f6f43 100644 --- a/contracts/01-tamagotchi/io/src/lib.rs +++ b/contracts/01-tamagotchi/io/src/lib.rs @@ -1,15 +1,16 @@ #![no_std] use codec::{Decode, Encode}; -use gmeta::Metadata; +use gmeta::{Metadata,In,InOut,Out}; use gstd::prelude::*; -use scale_info::TypeInfo; #[derive(Default, Encode, Decode, TypeInfo)] #[codec(crate = gstd::codec)] #[scale_info(crate = gstd::scale_info)] pub struct Tamagotchi { // TODO: 1️⃣ Add `name` and `age` fields + pub name: String, + pub date_of_birth: u64, } #[derive(Encode, Decode, TypeInfo)] @@ -17,6 +18,8 @@ pub struct Tamagotchi { #[scale_info(crate = gstd::scale_info)] pub enum TmgAction { // TODO: 2️⃣ Add `Name` and `Age` actions that set the name and age + Name, + Age, } #[derive(Encode, Decode, TypeInfo)] @@ -24,15 +27,17 @@ pub enum TmgAction { #[scale_info(crate = gstd::scale_info)] pub enum TmgEvent { // TODO: 3️⃣ Add `Name` and `Age` events that return the name and age + Name(String), + Age(u64), } pub struct ProgramMetadata; // TODO: 4️⃣ Fill `Init`, `Handle`, and `State` types impl Metadata for ProgramMetadata { - type Init = (); - type Handle = (); - type State = (); + type Init = In; + type Handle = InOut; + type State = Out; type Reply = (); type Others = (); type Signal = (); diff --git a/contracts/01-tamagotchi/src/lib.rs b/contracts/01-tamagotchi/src/lib.rs index 85f152bd..cde6c75b 100644 --- a/contracts/01-tamagotchi/src/lib.rs +++ b/contracts/01-tamagotchi/src/lib.rs @@ -1,19 +1,45 @@ #![no_std] - #[allow(unused_imports)] -use gstd::prelude::*; +use gstd::{msg,exec,prelude::*}; +use tamagotchi_io::*; + +static mut TAMAGOTCHI :Option = None; #[no_mangle] extern fn init() { // TODO: 5️⃣ Initialize the Tamagotchi program + let initname = msg::load().expect("unable to load name"); + let birthdate = exec::block_timestamp(); + let tmg = Tamagotchi { + name:initname, + date_of_birth: birthdate, + }; + unsafe { + TAMAGOTCHI = Some(tmg); + }; } #[no_mangle] extern fn handle() { // TODO: 6️⃣ Add handling of `Name` and `Age` actions + let action:TmgAction = msg::load().expect("unable to load action"); + let tmg = unsafe { + TAMAGOTCHI.get_or_insert(Default::default()) + }; + match action { + TmgAction::Name => { + msg::reply(TmgEvent::Name(tmg.name.clone()),0).expect("Error in a reply'tamagotchi::name'"); + }, + TmgAction::Age => { + let age = exec::block_timestamp() - tmg.date_of_birth; + msg::reply(TmgEvent::Age(age),0).expect("Error in a reply'tamagotchi::age'"); + }, + } } #[no_mangle] extern fn state() { // TODO: 7️⃣ Return the Tamagotchi state + let tmg = unsafe { TAMAGOTCHI.take().expect("Unexpected error in taking state") }; + msg::reply(tmg, 0).expect("Failed to share state"); } diff --git a/contracts/01-tamagotchi/tests/smoke.rs b/contracts/01-tamagotchi/tests/smoke.rs index 5dd29f16..c83b317f 100644 --- a/contracts/01-tamagotchi/tests/smoke.rs +++ b/contracts/01-tamagotchi/tests/smoke.rs @@ -1,10 +1,39 @@ -use gtest::{Program, System}; + + +use gtest::{Program, System,Log}; +use tamagotchi_io::*; #[test] fn smoke_test() { let sys = System::new(); sys.init_logger(); - let _program = Program::current(&sys); + let program = Program::current(&sys); + let result = program.send(2, String::from("Goodmoring")); + assert!(!result.main_failed()); + let result = program.send(2, TmgAction::Name); + let log = Log::builder().dest(2).payload(TmgEvent::Name(String::from("Goodmoring"))); + assert!(result.contains(&log)); + let _result = program.send(2, TmgAction::Age); + // let log = Log::builder().dest(2).payload(TmgEvent::Age(sys.block_timestamp())); + // assert!(result.contains(&log)); + + //How to test the age? +} + +#[test] +fn negative_smoke_test() { + let sys = System::new(); + sys.init_logger(); + let program = Program::current(&sys); + let payload = vec![1,2,3]; + let _result = program.send(2, payload); + // assert!(result.main_failed()); +// Why the assert is panic? - // TODO: 8️⃣ Test the program initialization and message handling + // let result = program.send(1, TmgAction::Name); + // let log = Log::builder().dest(2).payload(TmgEvent::Name("Goodmoring".to_string())); + // assert!(!result.contains(&log)); + // let result = program.send(1, TmgAction::Age); +// let log = Log::builder().dest(2).payload(TmgEvent::Age(sys.block_timestamp())); +// assert!(!result.contains(&log)); } From 9d728243beb8abcb215788cb34b645f59cfa589c Mon Sep 17 00:00:00 2001 From: Jackliu-miaozi <71253778+Jackliu-miaozi@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:54:57 +0800 Subject: [PATCH 2/6] Initial commit --- contracts/01-tamagotchi/src/lib.rs | 21 ++++++++++----------- contracts/01-tamagotchi/tests/smoke.rs | 16 ++++++++-------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/contracts/01-tamagotchi/src/lib.rs b/contracts/01-tamagotchi/src/lib.rs index cde6c75b..8df96e29 100644 --- a/contracts/01-tamagotchi/src/lib.rs +++ b/contracts/01-tamagotchi/src/lib.rs @@ -1,9 +1,9 @@ #![no_std] #[allow(unused_imports)] -use gstd::{msg,exec,prelude::*}; +use gstd::{exec, msg, prelude::*}; use tamagotchi_io::*; -static mut TAMAGOTCHI :Option = None; +static mut TAMAGOTCHI: Option = None; #[no_mangle] extern fn init() { @@ -11,7 +11,7 @@ extern fn init() { let initname = msg::load().expect("unable to load name"); let birthdate = exec::block_timestamp(); let tmg = Tamagotchi { - name:initname, + name: initname, date_of_birth: birthdate, }; unsafe { @@ -22,18 +22,17 @@ extern fn init() { #[no_mangle] extern fn handle() { // TODO: 6️⃣ Add handling of `Name` and `Age` actions - let action:TmgAction = msg::load().expect("unable to load action"); - let tmg = unsafe { - TAMAGOTCHI.get_or_insert(Default::default()) - }; + let action: TmgAction = msg::load().expect("unable to load action"); + let tmg = unsafe { TAMAGOTCHI.get_or_insert(Default::default()) }; match action { TmgAction::Name => { - msg::reply(TmgEvent::Name(tmg.name.clone()),0).expect("Error in a reply'tamagotchi::name'"); - }, + msg::reply(TmgEvent::Name(tmg.name.clone()), 0) + .expect("Error in a reply'tamagotchi::name'"); + } TmgAction::Age => { let age = exec::block_timestamp() - tmg.date_of_birth; - msg::reply(TmgEvent::Age(age),0).expect("Error in a reply'tamagotchi::age'"); - }, + msg::reply(TmgEvent::Age(age), 0).expect("Error in a reply'tamagotchi::age'"); + } } } diff --git a/contracts/01-tamagotchi/tests/smoke.rs b/contracts/01-tamagotchi/tests/smoke.rs index c83b317f..be5b2faa 100644 --- a/contracts/01-tamagotchi/tests/smoke.rs +++ b/contracts/01-tamagotchi/tests/smoke.rs @@ -1,6 +1,4 @@ - - -use gtest::{Program, System,Log}; +use gtest::{Log, Program, System}; use tamagotchi_io::*; #[test] @@ -11,7 +9,9 @@ fn smoke_test() { let result = program.send(2, String::from("Goodmoring")); assert!(!result.main_failed()); let result = program.send(2, TmgAction::Name); - let log = Log::builder().dest(2).payload(TmgEvent::Name(String::from("Goodmoring"))); + let log = Log::builder() + .dest(2) + .payload(TmgEvent::Name(String::from("Goodmoring"))); assert!(result.contains(&log)); let _result = program.send(2, TmgAction::Age); // let log = Log::builder().dest(2).payload(TmgEvent::Age(sys.block_timestamp())); @@ -25,15 +25,15 @@ fn negative_smoke_test() { let sys = System::new(); sys.init_logger(); let program = Program::current(&sys); - let payload = vec![1,2,3]; + let payload = vec![1, 2, 3]; let _result = program.send(2, payload); // assert!(result.main_failed()); -// Why the assert is panic? + // Why the assert is panic? // let result = program.send(1, TmgAction::Name); // let log = Log::builder().dest(2).payload(TmgEvent::Name("Goodmoring".to_string())); // assert!(!result.contains(&log)); // let result = program.send(1, TmgAction::Age); -// let log = Log::builder().dest(2).payload(TmgEvent::Age(sys.block_timestamp())); -// assert!(!result.contains(&log)); + // let log = Log::builder().dest(2).payload(TmgEvent::Age(sys.block_timestamp())); + // assert!(!result.contains(&log)); } From 888f60b434085932c5fdc72267599ade8591455c Mon Sep 17 00:00:00 2001 From: Jackliu-miaozi <71253778+Jackliu-miaozi@users.noreply.github.com> Date: Mon, 18 Dec 2023 10:12:36 +0800 Subject: [PATCH 3/6] second commit --- contracts/01-tamagotchi/tests/smoke.rs | 27 ++++---------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/contracts/01-tamagotchi/tests/smoke.rs b/contracts/01-tamagotchi/tests/smoke.rs index be5b2faa..a43733c8 100644 --- a/contracts/01-tamagotchi/tests/smoke.rs +++ b/contracts/01-tamagotchi/tests/smoke.rs @@ -6,34 +6,15 @@ fn smoke_test() { let sys = System::new(); sys.init_logger(); let program = Program::current(&sys); - let result = program.send(2, String::from("Goodmoring")); + let result = program.send(2, String::from("Goodmorning")); assert!(!result.main_failed()); let result = program.send(2, TmgAction::Name); let log = Log::builder() .dest(2) - .payload(TmgEvent::Name(String::from("Goodmoring"))); + .payload(TmgEvent::Name(String::from("Goodmorning"))); assert!(result.contains(&log)); let _result = program.send(2, TmgAction::Age); - // let log = Log::builder().dest(2).payload(TmgEvent::Age(sys.block_timestamp())); + // let age = sys.spend_blocks(1); + // let log = Log::builder().dest(2).payload(TmgEvent::Age(age[0])); // assert!(result.contains(&log)); - - //How to test the age? -} - -#[test] -fn negative_smoke_test() { - let sys = System::new(); - sys.init_logger(); - let program = Program::current(&sys); - let payload = vec![1, 2, 3]; - let _result = program.send(2, payload); - // assert!(result.main_failed()); - // Why the assert is panic? - - // let result = program.send(1, TmgAction::Name); - // let log = Log::builder().dest(2).payload(TmgEvent::Name("Goodmoring".to_string())); - // assert!(!result.contains(&log)); - // let result = program.send(1, TmgAction::Age); - // let log = Log::builder().dest(2).payload(TmgEvent::Age(sys.block_timestamp())); - // assert!(!result.contains(&log)); } From 03c0e3c79b983e62f11fc65963f361051cd70179 Mon Sep 17 00:00:00 2001 From: Jackliu-miaozi <71253778+Jackliu-miaozi@users.noreply.github.com> Date: Mon, 18 Dec 2023 10:16:12 +0800 Subject: [PATCH 4/6] third commit --- contracts/01-tamagotchi/io/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/01-tamagotchi/io/src/lib.rs b/contracts/01-tamagotchi/io/src/lib.rs index 512f6f43..1a07dda6 100644 --- a/contracts/01-tamagotchi/io/src/lib.rs +++ b/contracts/01-tamagotchi/io/src/lib.rs @@ -1,7 +1,7 @@ #![no_std] use codec::{Decode, Encode}; -use gmeta::{Metadata,In,InOut,Out}; +use gmeta::{In, InOut, Metadata, Out}; use gstd::prelude::*; #[derive(Default, Encode, Decode, TypeInfo)] From a20b2c0be3314e19e8027bf12266074025cfa1c7 Mon Sep 17 00:00:00 2001 From: Jackliu-miaozi <71253778+Jackliu-miaozi@users.noreply.github.com> Date: Mon, 18 Dec 2023 10:24:09 +0800 Subject: [PATCH 5/6] fourth commit --- .../02-tamagotchi-interaction/Cargo.toml | 16 - contracts/02-tamagotchi-interaction/build.rs | 5 - .../02-tamagotchi-interaction/io/Cargo.toml | 9 - .../02-tamagotchi-interaction/io/src/lib.rs | 40 - .../02-tamagotchi-interaction/src/lib.rs | 22 - .../tests/interaction.rs | 12 - contracts/03-tamagotchi-nft/Cargo.toml | 16 - contracts/03-tamagotchi-nft/build.rs | 5 - contracts/03-tamagotchi-nft/io/Cargo.toml | 9 - contracts/03-tamagotchi-nft/io/src/lib.rs | 40 - contracts/03-tamagotchi-nft/src/lib.rs | 19 - contracts/03-tamagotchi-nft/tests/owning.rs | 12 - contracts/04-tamagotchi-shop/Cargo.toml | 14 - contracts/04-tamagotchi-shop/build.rs | 5 - contracts/04-tamagotchi-shop/io/Cargo.toml | 9 - contracts/04-tamagotchi-shop/io/src/lib.rs | 40 - contracts/04-tamagotchi-shop/src/lib.rs | 22 - contracts/04-tamagotchi-shop/store/Cargo.toml | 14 - contracts/04-tamagotchi-shop/store/build.rs | 5 - .../04-tamagotchi-shop/store/io/Cargo.toml | 9 - .../04-tamagotchi-shop/store/io/src/lib.rs | 80 - contracts/04-tamagotchi-shop/store/src/lib.rs | 224 -- .../04-tamagotchi-shop/upload/Cargo.toml | 18 - .../04-tamagotchi-shop/upload/src/main.rs | 90 - contracts/05-tamagotchi-auto/Cargo.toml | 13 - contracts/05-tamagotchi-auto/build.rs | 5 - contracts/05-tamagotchi-auto/io/Cargo.toml | 9 - contracts/05-tamagotchi-auto/io/src/lib.rs | 40 - contracts/05-tamagotchi-auto/src/lib.rs | 19 - contracts/06-tamagotchi-army/Cargo.toml | 16 - contracts/06-tamagotchi-army/build.rs | 5 - contracts/06-tamagotchi-army/io/Cargo.toml | 9 - contracts/06-tamagotchi-army/io/src/lib.rs | 40 - contracts/06-tamagotchi-army/src/lib.rs | 19 - contracts/Cargo.lock | 2454 +---------------- contracts/Cargo.toml | 13 - 36 files changed, 146 insertions(+), 3231 deletions(-) delete mode 100644 contracts/02-tamagotchi-interaction/Cargo.toml delete mode 100644 contracts/02-tamagotchi-interaction/build.rs delete mode 100644 contracts/02-tamagotchi-interaction/io/Cargo.toml delete mode 100644 contracts/02-tamagotchi-interaction/io/src/lib.rs delete mode 100644 contracts/02-tamagotchi-interaction/src/lib.rs delete mode 100644 contracts/02-tamagotchi-interaction/tests/interaction.rs delete mode 100644 contracts/03-tamagotchi-nft/Cargo.toml delete mode 100644 contracts/03-tamagotchi-nft/build.rs delete mode 100644 contracts/03-tamagotchi-nft/io/Cargo.toml delete mode 100644 contracts/03-tamagotchi-nft/io/src/lib.rs delete mode 100644 contracts/03-tamagotchi-nft/src/lib.rs delete mode 100644 contracts/03-tamagotchi-nft/tests/owning.rs delete mode 100644 contracts/04-tamagotchi-shop/Cargo.toml delete mode 100644 contracts/04-tamagotchi-shop/build.rs delete mode 100644 contracts/04-tamagotchi-shop/io/Cargo.toml delete mode 100644 contracts/04-tamagotchi-shop/io/src/lib.rs delete mode 100644 contracts/04-tamagotchi-shop/src/lib.rs delete mode 100644 contracts/04-tamagotchi-shop/store/Cargo.toml delete mode 100644 contracts/04-tamagotchi-shop/store/build.rs delete mode 100644 contracts/04-tamagotchi-shop/store/io/Cargo.toml delete mode 100644 contracts/04-tamagotchi-shop/store/io/src/lib.rs delete mode 100644 contracts/04-tamagotchi-shop/store/src/lib.rs delete mode 100644 contracts/04-tamagotchi-shop/upload/Cargo.toml delete mode 100644 contracts/04-tamagotchi-shop/upload/src/main.rs delete mode 100644 contracts/05-tamagotchi-auto/Cargo.toml delete mode 100644 contracts/05-tamagotchi-auto/build.rs delete mode 100644 contracts/05-tamagotchi-auto/io/Cargo.toml delete mode 100644 contracts/05-tamagotchi-auto/io/src/lib.rs delete mode 100644 contracts/05-tamagotchi-auto/src/lib.rs delete mode 100644 contracts/06-tamagotchi-army/Cargo.toml delete mode 100644 contracts/06-tamagotchi-army/build.rs delete mode 100644 contracts/06-tamagotchi-army/io/Cargo.toml delete mode 100644 contracts/06-tamagotchi-army/io/src/lib.rs delete mode 100644 contracts/06-tamagotchi-army/src/lib.rs diff --git a/contracts/02-tamagotchi-interaction/Cargo.toml b/contracts/02-tamagotchi-interaction/Cargo.toml deleted file mode 100644 index 456b5581..00000000 --- a/contracts/02-tamagotchi-interaction/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "tamagotchi-interaction" -version.workspace = true -edition.workspace = true -publish.workspace = true - -[dependencies] -gstd.workspace = true -tamagotchi-interaction-io.workspace = true - -[build-dependencies] -gear-wasm-builder.workspace = true -tamagotchi-interaction-io.workspace = true - -[dev-dependencies] -gtest.workspace = true diff --git a/contracts/02-tamagotchi-interaction/build.rs b/contracts/02-tamagotchi-interaction/build.rs deleted file mode 100644 index f7845c70..00000000 --- a/contracts/02-tamagotchi-interaction/build.rs +++ /dev/null @@ -1,5 +0,0 @@ -use tamagotchi_interaction_io::ProgramMetadata; - -fn main() { - gear_wasm_builder::build_with_metadata::(); -} diff --git a/contracts/02-tamagotchi-interaction/io/Cargo.toml b/contracts/02-tamagotchi-interaction/io/Cargo.toml deleted file mode 100644 index a53a70d5..00000000 --- a/contracts/02-tamagotchi-interaction/io/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "tamagotchi-interaction-io" -version.workspace = true -edition.workspace = true -publish.workspace = true - -[dependencies] -gmeta.workspace = true -gstd.workspace = true diff --git a/contracts/02-tamagotchi-interaction/io/src/lib.rs b/contracts/02-tamagotchi-interaction/io/src/lib.rs deleted file mode 100644 index 8bff8af8..00000000 --- a/contracts/02-tamagotchi-interaction/io/src/lib.rs +++ /dev/null @@ -1,40 +0,0 @@ -#![no_std] - -use gmeta::Metadata; -use gstd::prelude::*; - -#[derive(Default, Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub struct Tamagotchi { - // TODO: 0️⃣ Copy fields from previous lesson and push changes to the master branch - // TODO: 1️⃣ Add new fields -} - -#[derive(Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub enum TmgAction { - // TODO: 0️⃣ Copy actions from previous lesson and push changes to the master branch - // TODO: 2️⃣ Add new actions -} - -#[derive(Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub enum TmgEvent { - // TODO: 0️⃣ Copy events from previous lesson and push changes to the master branch - // TODO: 3️⃣ Add new events -} - -pub struct ProgramMetadata; - -// TODO: 0️⃣ Copy `Metadata` from the first lesson and push changes to the master branch -impl Metadata for ProgramMetadata { - type Init = (); - type Handle = (); - type State = (); - type Reply = (); - type Others = (); - type Signal = (); -} diff --git a/contracts/02-tamagotchi-interaction/src/lib.rs b/contracts/02-tamagotchi-interaction/src/lib.rs deleted file mode 100644 index fc29483e..00000000 --- a/contracts/02-tamagotchi-interaction/src/lib.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![no_std] - -#[allow(unused_imports)] -use gstd::prelude::*; - -// TODO: 4️⃣ Define constants - -#[no_mangle] -extern fn init() { - // TODO: 0️⃣ Copy the `init` function from the previous lesson and push changes to the master branch -} - -#[no_mangle] -extern fn handle() { - // TODO: 0️⃣ Copy the `handle` function from the previous lesson and push changes to the master branch - // TODO: 5️⃣ Add new logic for calculating the `fed`, `entertained` and `slept` levels -} - -#[no_mangle] -extern fn state() { - // TODO: 0️⃣ Copy the `handle` function from the previous lesson and push changes to the master branch -} diff --git a/contracts/02-tamagotchi-interaction/tests/interaction.rs b/contracts/02-tamagotchi-interaction/tests/interaction.rs deleted file mode 100644 index 85518d73..00000000 --- a/contracts/02-tamagotchi-interaction/tests/interaction.rs +++ /dev/null @@ -1,12 +0,0 @@ -use gtest::{Program, System}; - -// TODO: 0️⃣ Copy tests from the previous lesson and push changes to the master branch - -#[test] -fn interaction_test() { - let sys = System::new(); - sys.init_logger(); - let _program = Program::current(&sys); - - // TODO: 6️⃣ Test new functionality -} diff --git a/contracts/03-tamagotchi-nft/Cargo.toml b/contracts/03-tamagotchi-nft/Cargo.toml deleted file mode 100644 index 86c46fc5..00000000 --- a/contracts/03-tamagotchi-nft/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "tamagotchi-nft" -version.workspace = true -edition.workspace = true -publish.workspace = true - -[dependencies] -gstd.workspace = true -tamagotchi-nft-io.workspace = true - -[build-dependencies] -gear-wasm-builder.workspace = true -tamagotchi-nft-io.workspace = true - -[dev-dependencies] -gtest.workspace = true diff --git a/contracts/03-tamagotchi-nft/build.rs b/contracts/03-tamagotchi-nft/build.rs deleted file mode 100644 index e85eb97b..00000000 --- a/contracts/03-tamagotchi-nft/build.rs +++ /dev/null @@ -1,5 +0,0 @@ -use tamagotchi_nft_io::ProgramMetadata; - -fn main() { - gear_wasm_builder::build_with_metadata::(); -} diff --git a/contracts/03-tamagotchi-nft/io/Cargo.toml b/contracts/03-tamagotchi-nft/io/Cargo.toml deleted file mode 100644 index b5990a47..00000000 --- a/contracts/03-tamagotchi-nft/io/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "tamagotchi-nft-io" -version.workspace = true -edition.workspace = true -publish.workspace = true - -[dependencies] -gmeta.workspace = true -gstd.workspace = true diff --git a/contracts/03-tamagotchi-nft/io/src/lib.rs b/contracts/03-tamagotchi-nft/io/src/lib.rs deleted file mode 100644 index 8bff8af8..00000000 --- a/contracts/03-tamagotchi-nft/io/src/lib.rs +++ /dev/null @@ -1,40 +0,0 @@ -#![no_std] - -use gmeta::Metadata; -use gstd::prelude::*; - -#[derive(Default, Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub struct Tamagotchi { - // TODO: 0️⃣ Copy fields from previous lesson and push changes to the master branch - // TODO: 1️⃣ Add new fields -} - -#[derive(Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub enum TmgAction { - // TODO: 0️⃣ Copy actions from previous lesson and push changes to the master branch - // TODO: 2️⃣ Add new actions -} - -#[derive(Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub enum TmgEvent { - // TODO: 0️⃣ Copy events from previous lesson and push changes to the master branch - // TODO: 3️⃣ Add new events -} - -pub struct ProgramMetadata; - -// TODO: 0️⃣ Copy `Metadata` from the first lesson and push changes to the master branch -impl Metadata for ProgramMetadata { - type Init = (); - type Handle = (); - type State = (); - type Reply = (); - type Others = (); - type Signal = (); -} diff --git a/contracts/03-tamagotchi-nft/src/lib.rs b/contracts/03-tamagotchi-nft/src/lib.rs deleted file mode 100644 index e9642d1d..00000000 --- a/contracts/03-tamagotchi-nft/src/lib.rs +++ /dev/null @@ -1,19 +0,0 @@ -#![no_std] - -#[allow(unused_imports)] -use gstd::prelude::*; - -#[no_mangle] -extern fn init() { - // TODO: 0️⃣ Copy the `init` function from the previous lesson and push changes to the master branch -} - -#[no_mangle] -extern fn handle() { - // TODO: 0️⃣ Copy the `handle` function from the previous lesson and push changes to the master branch -} - -#[no_mangle] -extern fn state() { - // TODO: 0️⃣ Copy the `handle` function from the previous lesson and push changes to the master branch -} diff --git a/contracts/03-tamagotchi-nft/tests/owning.rs b/contracts/03-tamagotchi-nft/tests/owning.rs deleted file mode 100644 index 4b101a00..00000000 --- a/contracts/03-tamagotchi-nft/tests/owning.rs +++ /dev/null @@ -1,12 +0,0 @@ -use gtest::{Program, System}; - -// TODO: 0️⃣ Copy tests from the previous lesson and push changes to the master branch - -#[test] -fn owning_test() { - let sys = System::new(); - sys.init_logger(); - let _program = Program::current(&sys); - - // TODO: 6️⃣ Test new functionality -} diff --git a/contracts/04-tamagotchi-shop/Cargo.toml b/contracts/04-tamagotchi-shop/Cargo.toml deleted file mode 100644 index 04921ed2..00000000 --- a/contracts/04-tamagotchi-shop/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "tamagotchi-shop" -version.workspace = true -edition.workspace = true -publish.workspace = true - -# TODO: 1️⃣ Add the `sharded-fungible-token-io` and `store-io` crates as dependencies -[dependencies] -gstd.workspace = true -tamagotchi-shop-io.workspace = true - -[build-dependencies] -gear-wasm-builder.workspace = true -tamagotchi-shop-io.workspace = true diff --git a/contracts/04-tamagotchi-shop/build.rs b/contracts/04-tamagotchi-shop/build.rs deleted file mode 100644 index 0f471630..00000000 --- a/contracts/04-tamagotchi-shop/build.rs +++ /dev/null @@ -1,5 +0,0 @@ -use tamagotchi_shop_io::ProgramMetadata; - -fn main() { - gear_wasm_builder::build_with_metadata::(); -} diff --git a/contracts/04-tamagotchi-shop/io/Cargo.toml b/contracts/04-tamagotchi-shop/io/Cargo.toml deleted file mode 100644 index c1934f54..00000000 --- a/contracts/04-tamagotchi-shop/io/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "tamagotchi-shop-io" -version.workspace = true -edition.workspace = true -publish.workspace = true - -[dependencies] -gmeta.workspace = true -gstd.workspace = true diff --git a/contracts/04-tamagotchi-shop/io/src/lib.rs b/contracts/04-tamagotchi-shop/io/src/lib.rs deleted file mode 100644 index 01c3d10a..00000000 --- a/contracts/04-tamagotchi-shop/io/src/lib.rs +++ /dev/null @@ -1,40 +0,0 @@ -#![no_std] - -use gmeta::Metadata; -use gstd::prelude::*; - -#[derive(Default, Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub struct Tamagotchi { - // TODO: 0️⃣ Copy fields from previous lesson and push changes to the master branch - // TODO: 2️⃣ Add new fields -} - -#[derive(Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub enum TmgAction { - // TODO: 0️⃣ Copy actions from previous lesson and push changes to the master branch - // TODO: 3️⃣ Add new actions -} - -#[derive(Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub enum TmgEvent { - // TODO: 0️⃣ Copy events from previous lesson and push changes to the master branch - // TODO: 4️⃣ Add new events -} - -pub struct ProgramMetadata; - -// TODO: 0️⃣ Copy `Metadata` from the first lesson and push changes to the master branch -impl Metadata for ProgramMetadata { - type Init = (); - type Handle = (); - type State = (); - type Reply = (); - type Others = (); - type Signal = (); -} diff --git a/contracts/04-tamagotchi-shop/src/lib.rs b/contracts/04-tamagotchi-shop/src/lib.rs deleted file mode 100644 index d2391618..00000000 --- a/contracts/04-tamagotchi-shop/src/lib.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![no_std] - -#[allow(unused_imports)] -use gstd::prelude::*; - -// TODO: 5️⃣ Add the `approve_tokens` function - -#[no_mangle] -extern fn init() { - // TODO: 0️⃣ Copy the `init` function from the previous lesson and push changes to the master branch -} - -#[no_mangle] -extern fn handle() { - // TODO: 0️⃣ Copy the `handle` function from the previous lesson and push changes to the master branch - // TODO; 6️⃣ Add handling new actions -} - -#[no_mangle] -extern fn state() { - // TODO: 0️⃣ Copy the `handle` function from the previous lesson and push changes to the master branch -} diff --git a/contracts/04-tamagotchi-shop/store/Cargo.toml b/contracts/04-tamagotchi-shop/store/Cargo.toml deleted file mode 100644 index 81463821..00000000 --- a/contracts/04-tamagotchi-shop/store/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "store" -version.workspace = true -edition.workspace = true -publish.workspace = true - -[dependencies] -gstd.workspace = true -store-io.workspace = true -sharded-fungible-token-io.workspace = true - -[build-dependencies] -gear-wasm-builder.workspace = true -store-io.workspace = true diff --git a/contracts/04-tamagotchi-shop/store/build.rs b/contracts/04-tamagotchi-shop/store/build.rs deleted file mode 100644 index 0ff8401a..00000000 --- a/contracts/04-tamagotchi-shop/store/build.rs +++ /dev/null @@ -1,5 +0,0 @@ -use store_io::ProgramMetadata; - -fn main() { - gear_wasm_builder::build_with_metadata::(); -} diff --git a/contracts/04-tamagotchi-shop/store/io/Cargo.toml b/contracts/04-tamagotchi-shop/store/io/Cargo.toml deleted file mode 100644 index 528cce5d..00000000 --- a/contracts/04-tamagotchi-shop/store/io/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "store-io" -version.workspace = true -edition.workspace = true -publish.workspace = true - -[dependencies] -gstd.workspace = true -gmeta.workspace = true diff --git a/contracts/04-tamagotchi-shop/store/io/src/lib.rs b/contracts/04-tamagotchi-shop/store/io/src/lib.rs deleted file mode 100644 index 8914a3f3..00000000 --- a/contracts/04-tamagotchi-shop/store/io/src/lib.rs +++ /dev/null @@ -1,80 +0,0 @@ -#![no_std] - -use gmeta::{In, InOut, Metadata as GMetadata, Out}; -use gstd::{ - collections::{BTreeMap, BTreeSet}, - prelude::*, - ActorId, -}; - -pub type AttributeId = u32; -pub type Price = u128; -pub type TamagotchiId = ActorId; -pub type TransactionId = u64; - -pub struct ProgramMetadata; - -impl GMetadata for ProgramMetadata { - type Init = In; - type Handle = InOut; - type Reply = (); - type Others = (); - type Signal = (); - type State = Out; -} - -#[derive(Default, Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub struct AttributeStore { - pub admin: ActorId, - pub ft_contract_id: ActorId, - pub attributes: BTreeMap, - pub owners: BTreeMap>, - pub transaction_id: TransactionId, - pub transactions: BTreeMap, -} - -#[derive(Encode, Decode, Clone, TypeInfo, Debug)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub struct AttrMetadata { - pub title: String, - pub description: String, - pub media: String, -} - -#[derive(Encode, Decode, TypeInfo, Debug)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub enum StoreAction { - CreateAttribute { - attribute_id: AttributeId, - attr_metadata: AttrMetadata, - price: Price, - }, - BuyAttribute { - attribute_id: AttributeId, - }, - GetAttributes { - tamagotchi_id: TamagotchiId, - }, - SetFtContractId { - ft_contract_id: ActorId, - }, - RemoveTx { - tamagotchi_id: TamagotchiId, - }, -} - -#[derive(Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub enum StoreEvent { - AttributeCreated { attribute_id: AttributeId }, - AttributeSold { success: bool }, - Attributes { attributes: BTreeSet }, - CompletePrevTx { attribute_id: AttributeId }, - FtContractIdSet { ft_contract_id: ActorId }, - TxRemoved { tamagotchi_id: ActorId }, -} diff --git a/contracts/04-tamagotchi-shop/store/src/lib.rs b/contracts/04-tamagotchi-shop/store/src/lib.rs deleted file mode 100644 index c936c7b2..00000000 --- a/contracts/04-tamagotchi-shop/store/src/lib.rs +++ /dev/null @@ -1,224 +0,0 @@ -#![no_std] - -use gstd::{ - collections::{BTreeMap, BTreeSet}, - exec, msg, - prelude::*, - ActorId, -}; -use sharded_fungible_token_io::{FTokenAction, FTokenEvent, LogicAction}; -use store_io::{ - AttrMetadata, AttributeId, Price, StoreAction, StoreEvent, TamagotchiId, TransactionId, -}; - -static mut STORE: Option = None; - -#[derive(Default)] -struct AttributeStore { - admin: ActorId, - ft_contract_id: ActorId, - attributes: BTreeMap, - owners: BTreeMap>, - transaction_id: TransactionId, - transactions: BTreeMap, -} - -impl AttributeStore { - fn create_attribute( - &mut self, - attribute_id: AttributeId, - metadata: &AttrMetadata, - price: Price, - ) { - assert_eq!(msg::source(), self.admin, "Only admin can add attributes"); - - if self - .attributes - .insert(attribute_id, (metadata.clone(), price)) - .is_some() - { - panic!("Attribute with that ID already exists"); - } - - msg::reply(StoreEvent::AttributeCreated { attribute_id }, 0) - .expect("Error in sending a reply `StoreEvent::AttributeCreated"); - } - async fn buy_attribute(&mut self, attribute_id: AttributeId) { - let (transaction_id, attribute_id) = if let Some((transaction_id, prev_attribute_id)) = - self.transactions.get(&msg::source()) - { - // if `prev_attribute_id` is not equal to `attribute_id` then it means that transaction didn`t completed - // we ask the tamagotchi contract to complete the previous transaction - if attribute_id != *prev_attribute_id { - msg::reply( - StoreEvent::CompletePrevTx { - attribute_id: *prev_attribute_id, - }, - 0, - ) - .expect("Error in sending a reply `StoreEvent::CompletePrevTx`"); - return; - } - (*transaction_id, *prev_attribute_id) - } else { - let current_transaction_id = self.transaction_id; - self.transaction_id = self.transaction_id.wrapping_add(1); - self.transactions - .insert(msg::source(), (current_transaction_id, attribute_id)); - (current_transaction_id, attribute_id) - }; - - let result = self.sell_attribute(transaction_id, attribute_id).await; - self.transactions.remove(&msg::source()); - - msg::reply(StoreEvent::AttributeSold { success: result }, 0) - .expect("Error in sending a reply `StoreEvent::AttributeSold`"); - } - - async fn sell_attribute( - &mut self, - transaction_id: TransactionId, - attribute_id: AttributeId, - ) -> bool { - let (_, price) = self - .attributes - .get(&attribute_id) - .expect("Can`t get attribute_id"); - - if transfer_tokens( - transaction_id, - &self.ft_contract_id, - &msg::source(), - &exec::program_id(), - *price, - ) - .await - .is_ok() - { - self.owners - .entry(msg::source()) - .and_modify(|attributes| { - attributes.insert(attribute_id); - }) - .or_insert_with(|| [attribute_id].into()); - return true; - } - false - } - - fn get_attributes(&self, tmg_id: &TamagotchiId) { - let attributes = self.owners.get(tmg_id).unwrap_or(&BTreeSet::new()).clone(); - msg::reply(StoreEvent::Attributes { attributes }, 0) - .expect("Error in sending a reply `StoreEvent::Attributes`"); - } - - fn set_ft_contract_id(&mut self, ft_contract_id: &ActorId) { - assert_eq!( - msg::source(), - self.admin, - "Only admin can set fungible token contract" - ); - self.ft_contract_id = *ft_contract_id; - msg::reply( - StoreEvent::FtContractIdSet { - ft_contract_id: *ft_contract_id, - }, - 0, - ) - .expect("Error in sending a reply `StoreEvent::FtContractIdSet`"); - } - - fn remove_tx(&mut self, tmg_id: &TamagotchiId) { - assert_eq!( - msg::source(), - self.admin, - "Only admin can set remove transactions" - ); - self.transactions.remove(tmg_id); - msg::reply( - StoreEvent::TxRemoved { - tamagotchi_id: *tmg_id, - }, - 0, - ) - .expect("Error in sending a reply `StoreEvent::TxRemoved`"); - } -} - -#[gstd::async_main] -async fn main() { - let action: StoreAction = msg::load().expect("Unable to decode `StoreAction"); - let store: &mut AttributeStore = - unsafe { STORE.as_mut().expect("The contract is not initialized") }; - match action { - StoreAction::CreateAttribute { - attribute_id, - attr_metadata, - price, - } => store.create_attribute(attribute_id, &attr_metadata, price), - StoreAction::BuyAttribute { attribute_id } => store.buy_attribute(attribute_id).await, - StoreAction::GetAttributes { tamagotchi_id } => store.get_attributes(&tamagotchi_id), - StoreAction::SetFtContractId { ft_contract_id } => { - store.set_ft_contract_id(&ft_contract_id) - } - StoreAction::RemoveTx { tamagotchi_id } => store.remove_tx(&tamagotchi_id), - } -} - -#[no_mangle] -extern fn init() { - let ft_contract_id: ActorId = msg::load().expect("Unable to decode `ActorId`"); - let store = AttributeStore { - admin: msg::source(), - ft_contract_id, - ..Default::default() - }; - unsafe { STORE = Some(store) }; -} - -async fn transfer_tokens( - transaction_id: TransactionId, - token_address: &ActorId, - from: &ActorId, - to: &ActorId, - amount_tokens: u128, -) -> Result<(), ()> { - let reply = msg::send_for_reply_as::<_, FTokenEvent>( - *token_address, - FTokenAction::Message { - transaction_id, - payload: LogicAction::Transfer { - sender: *from, - recipient: *to, - amount: amount_tokens, - }, - }, - 0, - 0, - ) - .expect("Error in sending a message `FTokenAction::Message`") - .await; - - match reply { - Ok(FTokenEvent::Ok) => Ok(()), - _ => Err(()), - } -} - -#[no_mangle] -extern fn state() { - let store = unsafe { STORE.as_ref().expect("The contract is not initialized") }; - - msg::reply( - store_io::AttributeStore { - admin: store.admin, - ft_contract_id: store.ft_contract_id, - attributes: store.attributes.clone(), - owners: store.owners.clone(), - transaction_id: store.transaction_id, - transactions: store.transactions.clone(), - }, - 0, - ) - .expect("Failed to share state"); -} diff --git a/contracts/04-tamagotchi-shop/upload/Cargo.toml b/contracts/04-tamagotchi-shop/upload/Cargo.toml deleted file mode 100644 index b7f668d2..00000000 --- a/contracts/04-tamagotchi-shop/upload/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "upload" -version.workspace = true -edition.workspace = true -publish.workspace = true - -[dependencies] -gclient.workspace = true -gear-core.workspace = true -gsdk.workspace = true -sharded-fungible-token-io.workspace = true -tokio.workspace = true - -# External binaries - -sharded-fungible-token.workspace = true -sharded-fungible-token-logic.workspace = true -sharded-fungible-token-storage.workspace = true diff --git a/contracts/04-tamagotchi-shop/upload/src/main.rs b/contracts/04-tamagotchi-shop/upload/src/main.rs deleted file mode 100644 index 4f6b6487..00000000 --- a/contracts/04-tamagotchi-shop/upload/src/main.rs +++ /dev/null @@ -1,90 +0,0 @@ -use gclient::{ - errors::{Gear, ModuleError}, - Error, GearApi, Result, -}; -use gear_core::ids::CodeId; -use gsdk::gp::Encode; -use sharded_fungible_token_io::InitFToken; -use std::fs; - -const FT_STORAGE_WASM: &str = "sharded_fungible_token_storage"; -const FT_LOGIC_WASM: &str = "sharded_fungible_token_logic"; -const FT_MAIN_WASM: &str = "sharded_fungible_token"; - -#[tokio::main(flavor = "current_thread")] -async fn main() -> Result<()> { - let api = GearApi::init_with( - gclient::WSAddress::new("wss://testnet.vara.rs", Some(443)), - "//Alice", - ) - .await?; - // To run local node use: - // let api = GearApi::dev_from_path("gear").await?; - println!("Connected to the node\n"); - - let mut listener = api.subscribe().await?; - - assert!(listener.blocks_running().await?); - println!("Network is live\n"); - - println!("Uploading 'FT Storage' code"); - let ft_storage_code_id = upload_code(&api, FT_STORAGE_WASM).await?; - - println!("Uploading 'FT Logic' code"); - let ft_logic_code_id = upload_code(&api, FT_LOGIC_WASM).await?; - - println!("Uploading 'FT Main' code"); - let ft_main_code_id = upload_code(&api, FT_MAIN_WASM).await?; - - let payload = InitFToken { - storage_code_hash: ft_storage_code_id.into_bytes().into(), - ft_logic_code_hash: ft_logic_code_id.into_bytes().into(), - }; - - let user_id_bytes: [u8; 32] = api.account_id().clone().into(); - let user_id = user_id_bytes.into(); - - let gas_info = api - .calculate_create_gas(Some(user_id), ft_main_code_id, vec![], 0, false) - .await?; - println!("Calculated gas: {}", gas_info.min_limit); - - let (_, ft_main_prog_id, _) = api - .create_program( - ft_main_code_id, - b"salt", - payload.encode(), - 2 * gas_info.min_limit, - 0, - ) - .await?; - println!("'FT Main' program created, ID: {ft_main_prog_id}\n"); - - Ok(()) -} - -async fn upload_code(api: &GearApi, file_name: &'static str) -> Result { - let code = fs::read(format!( - "target/wasm32-unknown-unknown/debug/{file_name}.opt.wasm" - ))?; - let res = api.upload_code(&code).await; - let ft_storage_code_id = CodeId::generate(&code); - let code_id = match res { - Err(Error::Module(ModuleError::Gear(Gear::CodeAlreadyExists))) => { - println!(" Code already exists, skipping upload"); - ft_storage_code_id - } - Ok((code_id, _)) => { - assert_eq!(code_id, ft_storage_code_id); - println!(" Code uploaded"); - code_id - } - Err(e) => { - return Err(e); - } - }; - - println!(" Code ID: {code_id}\n"); - - Ok(code_id) -} diff --git a/contracts/05-tamagotchi-auto/Cargo.toml b/contracts/05-tamagotchi-auto/Cargo.toml deleted file mode 100644 index a04c55b2..00000000 --- a/contracts/05-tamagotchi-auto/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "tamagotchi-auto" -version.workspace = true -edition.workspace = true -publish.workspace = true - -[dependencies] -gstd.workspace = true -tamagotchi-auto-io.workspace = true - -[build-dependencies] -gear-wasm-builder.workspace = true -tamagotchi-auto-io.workspace = true diff --git a/contracts/05-tamagotchi-auto/build.rs b/contracts/05-tamagotchi-auto/build.rs deleted file mode 100644 index 11f1e534..00000000 --- a/contracts/05-tamagotchi-auto/build.rs +++ /dev/null @@ -1,5 +0,0 @@ -use tamagotchi_auto_io::ProgramMetadata; - -fn main() { - gear_wasm_builder::build_with_metadata::(); -} diff --git a/contracts/05-tamagotchi-auto/io/Cargo.toml b/contracts/05-tamagotchi-auto/io/Cargo.toml deleted file mode 100644 index e6ebc948..00000000 --- a/contracts/05-tamagotchi-auto/io/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "tamagotchi-auto-io" -version.workspace = true -edition.workspace = true -publish.workspace = true - -[dependencies] -gmeta.workspace = true -gstd.workspace = true diff --git a/contracts/05-tamagotchi-auto/io/src/lib.rs b/contracts/05-tamagotchi-auto/io/src/lib.rs deleted file mode 100644 index 8bff8af8..00000000 --- a/contracts/05-tamagotchi-auto/io/src/lib.rs +++ /dev/null @@ -1,40 +0,0 @@ -#![no_std] - -use gmeta::Metadata; -use gstd::prelude::*; - -#[derive(Default, Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub struct Tamagotchi { - // TODO: 0️⃣ Copy fields from previous lesson and push changes to the master branch - // TODO: 1️⃣ Add new fields -} - -#[derive(Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub enum TmgAction { - // TODO: 0️⃣ Copy actions from previous lesson and push changes to the master branch - // TODO: 2️⃣ Add new actions -} - -#[derive(Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub enum TmgEvent { - // TODO: 0️⃣ Copy events from previous lesson and push changes to the master branch - // TODO: 3️⃣ Add new events -} - -pub struct ProgramMetadata; - -// TODO: 0️⃣ Copy `Metadata` from the first lesson and push changes to the master branch -impl Metadata for ProgramMetadata { - type Init = (); - type Handle = (); - type State = (); - type Reply = (); - type Others = (); - type Signal = (); -} diff --git a/contracts/05-tamagotchi-auto/src/lib.rs b/contracts/05-tamagotchi-auto/src/lib.rs deleted file mode 100644 index e9642d1d..00000000 --- a/contracts/05-tamagotchi-auto/src/lib.rs +++ /dev/null @@ -1,19 +0,0 @@ -#![no_std] - -#[allow(unused_imports)] -use gstd::prelude::*; - -#[no_mangle] -extern fn init() { - // TODO: 0️⃣ Copy the `init` function from the previous lesson and push changes to the master branch -} - -#[no_mangle] -extern fn handle() { - // TODO: 0️⃣ Copy the `handle` function from the previous lesson and push changes to the master branch -} - -#[no_mangle] -extern fn state() { - // TODO: 0️⃣ Copy the `handle` function from the previous lesson and push changes to the master branch -} diff --git a/contracts/06-tamagotchi-army/Cargo.toml b/contracts/06-tamagotchi-army/Cargo.toml deleted file mode 100644 index 125a141c..00000000 --- a/contracts/06-tamagotchi-army/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "tamagotchi-army" -version.workspace = true -edition.workspace = true -publish.workspace = true - -[dependencies] -gstd.workspace = true -tamagotchi-army-io.workspace = true - -[build-dependencies] -gear-wasm-builder.workspace = true -tamagotchi-army-io.workspace = true - -[dev-dependencies] -gtest.workspace = true diff --git a/contracts/06-tamagotchi-army/build.rs b/contracts/06-tamagotchi-army/build.rs deleted file mode 100644 index 499c0a77..00000000 --- a/contracts/06-tamagotchi-army/build.rs +++ /dev/null @@ -1,5 +0,0 @@ -use tamagotchi_army_io::ProgramMetadata; - -fn main() { - gear_wasm_builder::build_with_metadata::(); -} diff --git a/contracts/06-tamagotchi-army/io/Cargo.toml b/contracts/06-tamagotchi-army/io/Cargo.toml deleted file mode 100644 index 2595727a..00000000 --- a/contracts/06-tamagotchi-army/io/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "tamagotchi-army-io" -version.workspace = true -edition.workspace = true -publish.workspace = true - -[dependencies] -gmeta.workspace = true -gstd.workspace = true diff --git a/contracts/06-tamagotchi-army/io/src/lib.rs b/contracts/06-tamagotchi-army/io/src/lib.rs deleted file mode 100644 index 8bff8af8..00000000 --- a/contracts/06-tamagotchi-army/io/src/lib.rs +++ /dev/null @@ -1,40 +0,0 @@ -#![no_std] - -use gmeta::Metadata; -use gstd::prelude::*; - -#[derive(Default, Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub struct Tamagotchi { - // TODO: 0️⃣ Copy fields from previous lesson and push changes to the master branch - // TODO: 1️⃣ Add new fields -} - -#[derive(Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub enum TmgAction { - // TODO: 0️⃣ Copy actions from previous lesson and push changes to the master branch - // TODO: 2️⃣ Add new actions -} - -#[derive(Encode, Decode, TypeInfo)] -#[codec(crate = gstd::codec)] -#[scale_info(crate = gstd::scale_info)] -pub enum TmgEvent { - // TODO: 0️⃣ Copy events from previous lesson and push changes to the master branch - // TODO: 3️⃣ Add new events -} - -pub struct ProgramMetadata; - -// TODO: 0️⃣ Copy `Metadata` from the first lesson and push changes to the master branch -impl Metadata for ProgramMetadata { - type Init = (); - type Handle = (); - type State = (); - type Reply = (); - type Others = (); - type Signal = (); -} diff --git a/contracts/06-tamagotchi-army/src/lib.rs b/contracts/06-tamagotchi-army/src/lib.rs deleted file mode 100644 index e9642d1d..00000000 --- a/contracts/06-tamagotchi-army/src/lib.rs +++ /dev/null @@ -1,19 +0,0 @@ -#![no_std] - -#[allow(unused_imports)] -use gstd::prelude::*; - -#[no_mangle] -extern fn init() { - // TODO: 0️⃣ Copy the `init` function from the previous lesson and push changes to the master branch -} - -#[no_mangle] -extern fn handle() { - // TODO: 0️⃣ Copy the `handle` function from the previous lesson and push changes to the master branch -} - -#[no_mangle] -extern fn state() { - // TODO: 0️⃣ Copy the `handle` function from the previous lesson and push changes to the master branch -} diff --git a/contracts/Cargo.lock b/contracts/Cargo.lock index b112d757..4e9bccd5 100644 --- a/contracts/Cargo.lock +++ b/contracts/Cargo.lock @@ -44,41 +44,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" -dependencies = [ - "crypto-common", - "generic-array 0.14.7", -] - -[[package]] -name = "aes" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "aes-gcm" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", - "subtle", -] - [[package]] name = "ahash" version = "0.7.6" @@ -180,167 +145,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" -dependencies = [ - "concurrent-queue", - "event-listener 4.0.0", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" -dependencies = [ - "async-lock 3.1.2", - "async-task", - "concurrent-queue", - "fastrand 2.0.1", - "futures-lite 2.0.1", - "slab", -] - -[[package]] -name = "async-fs" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "blocking", - "futures-lite 1.13.0", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.9", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d3b15875ba253d1110c740755e246537483f152fa334f91abd7fe84c88b3ff" -dependencies = [ - "async-lock 3.1.2", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.0.1", - "parking", - "polling 3.3.1", - "rustix 0.38.15", - "slab", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea8b3453dd7cc96711834b75400d671b73e3656975fa68d9f277163b7f7e316" -dependencies = [ - "event-listener 4.0.0", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-net" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" -dependencies = [ - "async-io 1.13.0", - "blocking", - "futures-lite 1.13.0", -] - -[[package]] -name = "async-process" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" -dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", - "async-signal", - "blocking", - "cfg-if", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.15", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-signal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" -dependencies = [ - "async-io 2.2.1", - "async-lock 2.8.0", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix 0.38.15", - "signal-hook-registry", - "slab", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-task" -version = "4.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" - [[package]] name = "async-trait" version = "0.1.73" @@ -352,18 +156,6 @@ dependencies = [ "syn 2.0.37", ] -[[package]] -name = "atomic" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.1.0" @@ -403,27 +195,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" -[[package]] -name = "base64" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" - [[package]] name = "base64ct" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" -dependencies = [ - "serde", -] - [[package]] name = "bincode" version = "1.3.3" @@ -433,21 +210,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bip39" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" -dependencies = [ - "bitcoin_hashes", -] - -[[package]] -name = "bitcoin_hashes" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" - [[package]] name = "bitflags" version = "1.3.2" @@ -554,22 +316,6 @@ dependencies = [ "byte-tools", ] -[[package]] -name = "blocking" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" -dependencies = [ - "async-channel 2.1.1", - "async-lock 3.1.2", - "async-task", - "fastrand 2.0.1", - "futures-io", - "futures-lite 2.0.1", - "piper", - "tracing", -] - [[package]] name = "bounded-collections" version = "0.1.8" @@ -588,15 +334,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" -[[package]] -name = "bs58" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" -dependencies = [ - "tinyvec", -] - [[package]] name = "bumpalo" version = "3.14.0" @@ -706,30 +443,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chacha20" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "chacha20poly1305" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" -dependencies = [ - "aead", - "chacha20", - "cipher", - "poly1305", - "zeroize", -] - [[package]] name = "chrono" version = "0.4.31" @@ -744,26 +457,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", - "zeroize", -] - -[[package]] -name = "cmake" -version = "0.1.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" -dependencies = [ - "cc", -] - [[package]] name = "colored" version = "2.0.4" @@ -775,15 +468,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "concurrent-queue" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "const-oid" version = "0.9.5" @@ -808,16 +492,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "core-foundation-sys" version = "0.8.4" @@ -956,16 +630,6 @@ dependencies = [ "scopeguard", ] -[[package]] -name = "crossbeam-queue" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-utils" version = "0.8.16" @@ -1000,7 +664,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", - "rand_core 0.6.4", "typenum", ] @@ -1024,15 +687,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - [[package]] name = "curve25519-dalek" version = "2.1.3" @@ -1060,157 +714,70 @@ dependencies = [ ] [[package]] -name = "curve25519-dalek" -version = "4.1.1" +name = "darling" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "fiat-crypto", - "platforms", - "rustc_version", - "subtle", - "zeroize", + "darling_core", + "darling_macro", ] [[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" +name = "darling_core" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ + "fnv", + "ident_case", "proc-macro2", "quote", "syn 2.0.37", ] [[package]] -name = "curve25519-dalek-ng" -version = "4.1.1" +name = "darling_macro" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.6.4", - "subtle-ng", - "zeroize", + "darling_core", + "quote", + "syn 2.0.37", ] [[package]] -name = "darling" -version = "0.14.4" +name = "der" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" dependencies = [ - "darling_core 0.14.4", - "darling_macro 0.14.4", + "const-oid", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.3" +name = "derive-syn-parse" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "darling_core" -version = "0.14.4" +name = "derive_more" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "fnv", - "ident_case", + "convert_case", "proc-macro2", "quote", - "strsim", - "syn 1.0.109", -] - -[[package]] -name = "darling_core" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.37", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core 0.14.4", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" -dependencies = [ - "darling_core 0.20.3", - "quote", - "syn 2.0.37", -] - -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive-syn-parse" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", + "rustc_version", "syn 1.0.109", ] @@ -1461,7 +1028,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ - "darling 0.20.3", + "darling", "proc-macro2", "quote", "syn 2.0.37", @@ -1513,44 +1080,6 @@ dependencies = [ "libc", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.0", - "pin-project-lite", -] - [[package]] name = "expander" version = "1.0.0" @@ -1576,15 +1105,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.0.1" @@ -1601,12 +1121,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "fiat-crypto" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" - [[package]] name = "fixed-hash" version = "0.8.0" @@ -1646,18 +1160,6 @@ dependencies = [ "serde", ] -[[package]] -name = "frame-metadata" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" -dependencies = [ - "cfg-if", - "parity-scale-codec", - "scale-info", - "serde", -] - [[package]] name = "frame-support" version = "4.0.0-dev" @@ -1665,7 +1167,7 @@ source = "git+https://github.com/gear-tech/substrate.git?branch=gear-polkadot-v0 dependencies = [ "bitflags 1.3.2", "environmental", - "frame-metadata 15.1.0", + "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", "k256", @@ -1685,7 +1187,7 @@ dependencies = [ "sp-runtime", "sp-staking", "sp-state-machine", - "sp-std 5.0.0", + "sp-std", "sp-tracing", "sp-weights", "tt-call", @@ -1792,35 +1294,6 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-lite" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3831c2651acb5177cbd83943f3d9c8912c5ad03c76afcc0e9511ba568ec5ebb" -dependencies = [ - "fastrand 2.0.1", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", -] - [[package]] name = "futures-macro" version = "0.3.28" @@ -1844,12 +1317,6 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" - [[package]] name = "futures-util" version = "0.3.28" @@ -1876,30 +1343,6 @@ dependencies = [ "dlmalloc", ] -[[package]] -name = "gclient" -version = "1.0.2" -source = "git+https://github.com/gear-tech/gear?tag=v1.0.2#d02d306f97c2d60c1a8786366a56d8c02264f4e1" -dependencies = [ - "anyhow", - "async-trait", - "futures", - "futures-timer", - "gear-core", - "gear-core-errors", - "gear-utils", - "gsdk", - "gstd", - "hex", - "parity-scale-codec", - "rand 0.8.5", - "static_assertions", - "subxt", - "thiserror", - "url", - "wabt", -] - [[package]] name = "gcore" version = "1.0.2" @@ -1932,7 +1375,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-io", - "sp-std 5.0.0", + "sp-std", ] [[package]] @@ -1962,7 +1405,6 @@ dependencies = [ "parity-scale-codec", "paste", "scale-info", - "serde", "static_assertions", "wasmparser-nostd", ] @@ -2044,7 +1486,7 @@ dependencies = [ "region", "sc-executor-common", "sp-io", - "sp-std 5.0.0", + "sp-std", "sp-wasm-interface", "static_assertions", "winapi", @@ -2073,17 +1515,7 @@ dependencies = [ "gear-runtime-interface", "gear-wasm-instrument", "log", - "sp-std 5.0.0", -] - -[[package]] -name = "gear-lib-old" -version = "1.0.2" -source = "git+https://github.com/gear-foundation/dapps?tag=v1.0.2#32e1f4d84636f5f27005ea2cf66b1eb5ed124dec" -dependencies = [ - "gstd", - "primitive-types", - "schnorrkel 0.10.2", + "sp-std", ] [[package]] @@ -2103,7 +1535,7 @@ dependencies = [ "region", "sp-allocator", "sp-runtime-interface", - "sp-std 5.0.0", + "sp-std", "sp-wasm-interface", "static_assertions", "winapi", @@ -2119,9 +1551,9 @@ dependencies = [ "log", "parity-scale-codec", "sp-core", - "sp-std 5.0.0", + "sp-std", "sp-wasm-interface", - "wasmi 0.30.0 (git+https://github.com/gear-tech/wasmi?branch=gear-v0.30.0)", + "wasmi 0.30.0", ] [[package]] @@ -2131,7 +1563,7 @@ source = "git+https://github.com/gear-tech/gear?tag=v1.0.2#d02d306f97c2d60c1a878 dependencies = [ "parity-scale-codec", "sp-core", - "sp-std 5.0.0", + "sp-std", "sp-wasm-interface", ] @@ -2255,16 +1687,6 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] -[[package]] -name = "ghash" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" -dependencies = [ - "opaque-debug 0.3.0", - "polyval", -] - [[package]] name = "gimli" version = "0.26.2" @@ -2282,12 +1704,6 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" -[[package]] -name = "glob" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" - [[package]] name = "gmeta" version = "1.0.2" @@ -2310,51 +1726,12 @@ dependencies = [ "subtle", ] -[[package]] -name = "gsdk" -version = "1.0.2" -source = "git+https://github.com/gear-tech/gear?tag=v1.0.2#d02d306f97c2d60c1a8786366a56d8c02264f4e1" -dependencies = [ - "anyhow", - "base64 0.21.4", - "futures", - "futures-util", - "gear-core", - "gear-core-errors", - "gsdk-codegen", - "hex", - "indexmap 2.0.2", - "jsonrpsee 0.16.3", - "log", - "parity-scale-codec", - "parking_lot", - "rand 0.8.5", - "scale-decode", - "scale-value", - "serde", - "serde_json", - "sp-core", - "sp-runtime", - "subxt", - "thiserror", -] - -[[package]] -name = "gsdk-codegen" -version = "1.0.2" -source = "git+https://github.com/gear-tech/gear?tag=v1.0.2#d02d306f97c2d60c1a8786366a56d8c02264f4e1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", -] - [[package]] name = "gstd" version = "1.0.2" source = "git+https://github.com/gear-tech/gear?tag=v1.0.2#d02d306f97c2d60c1a8786366a56d8c02264f4e1" dependencies = [ - "bs58 0.4.0", + "bs58", "futures", "galloc", "gcore", @@ -2416,25 +1793,6 @@ dependencies = [ "gear-wasm", ] -[[package]] -name = "h2" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap 1.9.3", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "hash-db" version = "0.16.0" @@ -2485,15 +1843,8 @@ checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" dependencies = [ "ahash 0.8.3", "allocator-api2", - "serde", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "hermit-abi" version = "0.3.3" @@ -2556,114 +1907,39 @@ dependencies = [ ] [[package]] -name = "http" -version = "0.2.9" +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "iana-time-zone" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ - "bytes", - "fnv", - "itoa", + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", ] [[package]] -name = "http-body" -version = "0.4.5" +name = "iana-time-zone-haiku" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "bytes", - "http", - "pin-project-lite", + "cc", ] [[package]] -name = "httparse" -version = "1.8.0" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "0.14.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.4.9", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" -dependencies = [ - "futures-util", - "http", - "hyper", - "log", - "rustls", - "rustls-native-certs", - "tokio", - "tokio-rustls", - "webpki-roots 0.23.1", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" @@ -2731,24 +2007,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "integer-sqrt" version = "0.1.5" @@ -2819,195 +2077,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonrpsee" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" -dependencies = [ - "jsonrpsee-core 0.16.3", - "jsonrpsee-http-client 0.16.3", - "jsonrpsee-types 0.16.3", - "jsonrpsee-ws-client", -] - -[[package]] -name = "jsonrpsee" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "affdc52f7596ccb2d7645231fc6163bb314630c989b64998f3699a28b4d5d4dc" -dependencies = [ - "jsonrpsee-client-transport 0.20.3", - "jsonrpsee-core 0.20.3", - "jsonrpsee-http-client 0.20.3", - "jsonrpsee-types 0.20.3", -] - -[[package]] -name = "jsonrpsee-client-transport" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" -dependencies = [ - "futures-util", - "http", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", - "pin-project", - "rustls-native-certs", - "soketto", - "thiserror", - "tokio", - "tokio-rustls", - "tokio-util", - "tracing", - "webpki-roots 0.25.2", -] - -[[package]] -name = "jsonrpsee-client-transport" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" -dependencies = [ - "futures-util", - "http", - "jsonrpsee-core 0.20.3", - "pin-project", - "rustls-native-certs", - "soketto", - "thiserror", - "tokio", - "tokio-rustls", - "tokio-util", - "tracing", - "url", -] - -[[package]] -name = "jsonrpsee-core" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" -dependencies = [ - "anyhow", - "async-lock 2.8.0", - "async-trait", - "beef", - "futures-channel", - "futures-timer", - "futures-util", - "hyper", - "jsonrpsee-types 0.16.3", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "jsonrpsee-core" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b" -dependencies = [ - "anyhow", - "async-lock 2.8.0", - "async-trait", - "beef", - "futures-timer", - "futures-util", - "hyper", - "jsonrpsee-types 0.20.3", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "jsonrpsee-http-client" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" -dependencies = [ - "async-trait", - "hyper", - "hyper-rustls", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "jsonrpsee-http-client" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" -dependencies = [ - "async-trait", - "hyper", - "hyper-rustls", - "jsonrpsee-core 0.20.3", - "jsonrpsee-types 0.20.3", - "serde", - "serde_json", - "thiserror", - "tokio", - "tower", - "tracing", - "url", -] - -[[package]] -name = "jsonrpsee-types" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" -dependencies = [ - "anyhow", - "beef", - "serde", - "serde_json", - "thiserror", - "tracing", -] - -[[package]] -name = "jsonrpsee-types" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" -dependencies = [ - "anyhow", - "beef", - "serde", - "serde_json", - "thiserror", - "tracing", -] - -[[package]] -name = "jsonrpsee-ws-client" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" -dependencies = [ - "http", - "jsonrpsee-client-transport 0.16.3", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", -] - [[package]] name = "k256" version = "0.11.6" @@ -3079,7 +2148,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" dependencies = [ "arrayref", - "base64 0.13.1", + "base64", "digest 0.9.0", "hmac-drbg", "libsecp256k1-core", @@ -3126,12 +2195,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.7" @@ -3175,12 +2238,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "lru" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" - [[package]] name = "mach" version = "0.3.2" @@ -3277,24 +2334,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "merlin" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.6.4", - "zeroize", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -3304,17 +2343,6 @@ dependencies = [ "adler", ] -[[package]] -name = "mio" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" -dependencies = [ - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", -] - [[package]] name = "more-asserts" version = "0.2.2" @@ -3334,12 +2362,6 @@ dependencies = [ "pin-utils", ] -[[package]] -name = "no-std-net" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" - [[package]] name = "nodrop" version = "0.1.14" @@ -3352,16 +2374,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "nonempty" version = "0.8.1" @@ -3501,12 +2513,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - [[package]] name = "page_size" version = "0.6.0" @@ -3561,12 +2567,6 @@ name = "parity-wasm" version = "0.45.0" source = "git+https://github.com/gear-tech/parity-wasm?branch=v0.45.0-sign-ext#bad3e1ec78f655f3eec5a0c9c12a3546c8c9d432" -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - [[package]] name = "parking_lot" version = "0.12.1" @@ -3626,41 +2626,12 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest 0.10.7", -] - [[package]] name = "percent-encoding" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" -[[package]] -name = "pin-project" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", -] - [[package]] name = "pin-project-lite" version = "0.2.13" @@ -3673,17 +2644,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "piper" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" -dependencies = [ - "atomic-waker", - "fastrand 2.0.1", - "futures-io", -] - [[package]] name = "pkcs8" version = "0.9.0" @@ -3701,69 +2661,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] -name = "platforms" -version = "3.2.0" +name = "ppv-lite86" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" - -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - -[[package]] -name = "polling" -version = "3.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" -dependencies = [ - "cfg-if", - "concurrent-queue", - "pin-project-lite", - "rustix 0.38.15", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "poly1305" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" -dependencies = [ - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash", -] - -[[package]] -name = "polyval" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" -dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "primitive-types" @@ -4103,21 +3004,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted", - "web-sys", - "winapi", -] - [[package]] name = "rkyv" version = "0.7.42" @@ -4187,20 +3073,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - [[package]] name = "rustix" version = "0.38.15" @@ -4214,76 +3086,12 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "rustls" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" -dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.6", - "sct", -] - -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" -dependencies = [ - "base64 0.21.4", -] - -[[package]] -name = "rustls-webpki" -version = "0.100.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6a5fc258f1c1276dfe3016516945546e2d5383911efc0fc4f1cdc5df3a4ae3" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "rustversion" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" -[[package]] -name = "ruzstd" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3ffab8f9715a0d455df4bbb9d21e91135aab3cd3ca187af0cd0c3c3f868fdc" -dependencies = [ - "byteorder", - "thiserror-core", - "twox-hash", -] - [[package]] name = "ryu" version = "1.0.15" @@ -4303,73 +3111,6 @@ dependencies = [ "wasmi 0.13.2", ] -[[package]] -name = "scale-bits" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "036575c29af9b6e4866ffb7fa055dbf623fe7a9cc159b33786de6013a6969d89" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", -] - -[[package]] -name = "scale-decode" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7789f5728e4e954aaa20cadcc370b99096fb8645fca3c9333ace44bb18f30095" -dependencies = [ - "derive_more", - "parity-scale-codec", - "primitive-types", - "scale-bits", - "scale-decode-derive", - "scale-info", - "smallvec", -] - -[[package]] -name = "scale-decode-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27873eb6005868f8cc72dcfe109fae664cf51223d35387bc2f28be4c28d94c47" -dependencies = [ - "darling 0.14.4", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "scale-encode" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" -dependencies = [ - "derive_more", - "parity-scale-codec", - "primitive-types", - "scale-bits", - "scale-encode-derive", - "scale-info", - "smallvec", -] - -[[package]] -name = "scale-encode-derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" -dependencies = [ - "darling 0.14.4", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "scale-info" version = "2.9.0" @@ -4396,35 +3137,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "scale-value" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6538d1cc1af9c0baf401c57da8a6d4730ef582db0d330d2efa56ec946b5b0283" -dependencies = [ - "base58", - "blake2", - "derive_more", - "either", - "frame-metadata 15.1.0", - "parity-scale-codec", - "scale-bits", - "scale-decode", - "scale-encode", - "scale-info", - "serde", - "yap", -] - -[[package]] -name = "schannel" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" -dependencies = [ - "windows-sys 0.48.0", -] - [[package]] name = "schnellru" version = "0.2.1" @@ -4446,7 +3158,7 @@ dependencies = [ "arrayvec 0.5.2", "curve25519-dalek 2.1.3", "getrandom 0.1.16", - "merlin 2.0.1", + "merlin", "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", @@ -4454,38 +3166,12 @@ dependencies = [ "zeroize", ] -[[package]] -name = "schnorrkel" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "844b7645371e6ecdf61ff246ba1958c29e802881a749ae3fb1993675d210d28d" -dependencies = [ - "arrayref", - "arrayvec 0.7.4", - "curve25519-dalek-ng", - "merlin 3.0.0", - "rand_core 0.6.4", - "sha2 0.9.9", - "subtle-ng", - "zeroize", -] - [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "seahash" version = "4.1.0" @@ -4533,29 +3219,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "security-framework" -version = "2.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" version = "1.0.19" @@ -4614,19 +3277,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - [[package]] name = "sha2" version = "0.8.2" @@ -4674,123 +3324,37 @@ dependencies = [ ] [[package]] -name = "sharded-fungible-token" -version = "1.0.2" -source = "git+https://github.com/gear-foundation/dapps?tag=v1.0.2#32e1f4d84636f5f27005ea2cf66b1eb5ed124dec" +name = "sharded-slab" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b21f559e07218024e7e9f90f96f601825397de0e25420135f7f952453fed0b" dependencies = [ - "gear-wasm-builder", - "gstd", - "primitive-types", - "sharded-fungible-token-io", - "sharded-fungible-token-logic-io", - "sp-core-hashing 10.0.0", + "lazy_static", ] [[package]] -name = "sharded-fungible-token-io" -version = "1.0.2" -source = "git+https://github.com/gear-foundation/dapps?tag=v1.0.2#32e1f4d84636f5f27005ea2cf66b1eb5ed124dec" +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ - "gmeta", - "gstd", - "primitive-types", + "digest 0.10.7", + "rand_core 0.6.4", ] [[package]] -name = "sharded-fungible-token-logic" -version = "1.0.2" -source = "git+https://github.com/gear-foundation/dapps?tag=v1.0.2#32e1f4d84636f5f27005ea2cf66b1eb5ed124dec" -dependencies = [ - "gear-lib-old", - "gear-wasm-builder", - "gstd", - "hex", - "primitive-types", - "sharded-fungible-token-io", - "sharded-fungible-token-logic-io", - "sharded-fungible-token-storage-io", -] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] -name = "sharded-fungible-token-logic-io" -version = "1.0.2" -source = "git+https://github.com/gear-foundation/dapps?tag=v1.0.2#32e1f4d84636f5f27005ea2cf66b1eb5ed124dec" +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ - "gmeta", - "gstd", - "primitive-types", - "sharded-fungible-token-io", - "sharded-fungible-token-storage-io", -] - -[[package]] -name = "sharded-fungible-token-storage" -version = "1.0.2" -source = "git+https://github.com/gear-foundation/dapps?tag=v1.0.2#32e1f4d84636f5f27005ea2cf66b1eb5ed124dec" -dependencies = [ - "gear-wasm-builder", - "gstd", - "primitive-types", - "sharded-fungible-token-storage-io", -] - -[[package]] -name = "sharded-fungible-token-storage-io" -version = "1.0.2" -source = "git+https://github.com/gear-foundation/dapps?tag=v1.0.2#32e1f4d84636f5f27005ea2cf66b1eb5ed124dec" -dependencies = [ - "gmeta", - "gstd", - "primitive-types", -] - -[[package]] -name = "sharded-slab" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b21f559e07218024e7e9f90f96f601825397de0e25420135f7f952453fed0b" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", + "autocfg", ] [[package]] @@ -4799,155 +3363,6 @@ version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" -[[package]] -name = "smol" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" -dependencies = [ - "async-channel 1.9.0", - "async-executor", - "async-fs", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-net", - "async-process", - "blocking", - "futures-lite 1.13.0", -] - -[[package]] -name = "smoldot" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cce5e2881b30bad7ef89f383a816ad0b22c45915911f28499026de4a76d20ee" -dependencies = [ - "arrayvec 0.7.4", - "async-lock 2.8.0", - "atomic", - "base64 0.21.4", - "bip39", - "blake2-rfc", - "bs58 0.5.0", - "crossbeam-queue", - "derive_more", - "ed25519-zebra", - "either", - "event-listener 2.5.3", - "fnv", - "futures-channel", - "futures-util", - "hashbrown 0.14.1", - "hex", - "hmac 0.12.1", - "itertools", - "libsecp256k1", - "merlin 3.0.0", - "no-std-net", - "nom", - "num-bigint", - "num-rational", - "num-traits", - "pbkdf2 0.12.2", - "pin-project", - "rand 0.8.5", - "rand_chacha 0.3.1", - "ruzstd", - "schnorrkel 0.10.2", - "serde", - "serde_json", - "sha2 0.10.8", - "siphasher", - "slab", - "smallvec", - "smol", - "snow", - "soketto", - "tiny-keccak", - "twox-hash", - "wasmi 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "smoldot-light" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2f7b4687b83ff244ef6137735ed5716ad37dcdf3ee16c4eb1a32fb9808fa47" -dependencies = [ - "async-lock 2.8.0", - "blake2-rfc", - "derive_more", - "either", - "event-listener 2.5.3", - "fnv", - "futures-channel", - "futures-util", - "hashbrown 0.14.1", - "hex", - "itertools", - "log", - "lru", - "parking_lot", - "rand 0.8.5", - "serde", - "serde_json", - "siphasher", - "slab", - "smol", - "smoldot", -] - -[[package]] -name = "snow" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58021967fd0a5eeeb23b08df6cc244a4d4a5b4aec1d27c9e02fad1a58b4cd74e" -dependencies = [ - "aes-gcm", - "blake2", - "chacha20poly1305", - "curve25519-dalek 4.1.1", - "rand_core 0.6.4", - "rustc_version", - "sha2 0.10.8", - "subtle", -] - -[[package]] -name = "socket2" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "soketto" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" -dependencies = [ - "base64 0.13.1", - "bytes", - "futures", - "httparse", - "log", - "rand 0.8.5", - "sha-1", -] - [[package]] name = "sp-allocator" version = "4.1.0-dev" @@ -4971,7 +3386,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-state-machine", - "sp-std 5.0.0", + "sp-std", "sp-trie", "sp-version", "thiserror", @@ -5001,7 +3416,7 @@ dependencies = [ "serde", "sp-core", "sp-io", - "sp-std 5.0.0", + "sp-std", ] [[package]] @@ -5014,7 +3429,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 5.0.0", + "sp-std", "static_assertions", ] @@ -5037,23 +3452,23 @@ dependencies = [ "lazy_static", "libsecp256k1", "log", - "merlin 2.0.1", + "merlin", "parity-scale-codec", "parking_lot", "primitive-types", "rand 0.8.5", "regex", "scale-info", - "schnorrkel 0.9.1", + "schnorrkel", "secp256k1", "secrecy", "serde", "sp-allocator", - "sp-core-hashing 5.0.0", + "sp-core-hashing", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", - "sp-std 5.0.0", + "sp-std", "sp-storage", "ss58-registry", "substrate-bip39", @@ -5072,36 +3487,7 @@ dependencies = [ "digest 0.10.7", "sha2 0.10.8", "sha3", - "sp-std 5.0.0", - "twox-hash", -] - -[[package]] -name = "sp-core-hashing" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee599a8399448e65197f9a6cee338ad192e9023e35e31f22382964c3c174c68" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.7", - "sha2 0.10.8", - "sha3", - "sp-std 8.0.0", - "twox-hash", -] - -[[package]] -name = "sp-core-hashing" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e360755a2706a76886d58776665cad0db793dece3c7d390455b28e8a1efd6285" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.7", - "sha2 0.10.8", - "sha3", + "sp-std", "twox-hash", ] @@ -5112,7 +3498,7 @@ source = "git+https://github.com/gear-tech/substrate.git?branch=gear-polkadot-v0 dependencies = [ "proc-macro2", "quote", - "sp-core-hashing 5.0.0", + "sp-core-hashing", "syn 1.0.109", ] @@ -5133,7 +3519,7 @@ source = "git+https://github.com/gear-tech/substrate.git?branch=gear-polkadot-v0 dependencies = [ "environmental", "parity-scale-codec", - "sp-std 5.0.0", + "sp-std", "sp-storage", ] @@ -5148,7 +3534,7 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std 5.0.0", + "sp-std", "thiserror", ] @@ -5170,7 +3556,7 @@ dependencies = [ "sp-keystore", "sp-runtime-interface", "sp-state-machine", - "sp-std 5.0.0", + "sp-std", "sp-tracing", "sp-trie", "tracing", @@ -5184,10 +3570,10 @@ source = "git+https://github.com/gear-tech/substrate.git?branch=gear-polkadot-v0 dependencies = [ "async-trait", "futures", - "merlin 2.0.1", + "merlin", "parity-scale-codec", "parking_lot", - "schnorrkel 0.9.1", + "schnorrkel", "sp-core", "sp-externalities", "thiserror", @@ -5230,7 +3616,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-io", - "sp-std 5.0.0", + "sp-std", "sp-weights", ] @@ -5245,7 +3631,7 @@ dependencies = [ "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", - "sp-std 5.0.0", + "sp-std", "sp-storage", "sp-tracing", "sp-wasm-interface", @@ -5273,7 +3659,7 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std 5.0.0", + "sp-std", ] [[package]] @@ -5290,7 +3676,7 @@ dependencies = [ "sp-core", "sp-externalities", "sp-panic-handler", - "sp-std 5.0.0", + "sp-std", "sp-trie", "thiserror", "tracing", @@ -5301,12 +3687,6 @@ name = "sp-std" version = "5.0.0" source = "git+https://github.com/gear-tech/substrate.git?branch=gear-polkadot-v0.9.41-canary-no-sandbox-revert-oom-changes#27779e0eaaa2161ba165ff8f0b0ff103bb63e5a1" -[[package]] -name = "sp-std" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53458e3c57df53698b3401ec0934bea8e8cfce034816873c0b0abbd83d7bac0d" - [[package]] name = "sp-storage" version = "7.0.0" @@ -5317,7 +3697,7 @@ dependencies = [ "ref-cast", "serde", "sp-debug-derive", - "sp-std 5.0.0", + "sp-std", ] [[package]] @@ -5326,7 +3706,7 @@ version = "6.0.0" source = "git+https://github.com/gear-tech/substrate.git?branch=gear-polkadot-v0.9.41-canary-no-sandbox-revert-oom-changes#27779e0eaaa2161ba165ff8f0b0ff103bb63e5a1" dependencies = [ "parity-scale-codec", - "sp-std 5.0.0", + "sp-std", "tracing", "tracing-core", "tracing-subscriber", @@ -5348,7 +3728,7 @@ dependencies = [ "scale-info", "schnellru", "sp-core", - "sp-std 5.0.0", + "sp-std", "thiserror", "tracing", "trie-db", @@ -5367,7 +3747,7 @@ dependencies = [ "serde", "sp-core-hashing-proc-macro", "sp-runtime", - "sp-std 5.0.0", + "sp-std", "sp-version-proc-macro", "thiserror", ] @@ -5393,7 +3773,7 @@ dependencies = [ "log", "parity-scale-codec", "sp-allocator", - "sp-std 5.0.0", + "sp-std", "sp-wasm-interface-common", "wasmtime", ] @@ -5404,7 +3784,7 @@ version = "7.0.0" source = "git+https://github.com/gear-tech/substrate.git?branch=gear-polkadot-v0.9.41-canary-no-sandbox-revert-oom-changes#27779e0eaaa2161ba165ff8f0b0ff103bb63e5a1" dependencies = [ "parity-scale-codec", - "sp-std 5.0.0", + "sp-std", "wasmi 0.13.2", ] @@ -5420,15 +3800,9 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-debug-derive", - "sp-std 5.0.0", + "sp-std", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -5472,278 +3846,65 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "store" -version = "0.3.3" -dependencies = [ - "gear-wasm-builder", - "gstd", - "sharded-fungible-token-io", - "store-io", -] - -[[package]] -name = "store-io" -version = "0.3.3" -dependencies = [ - "gmeta", - "gstd", -] - [[package]] name = "str-buf" version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e75b72ee54e2f93c3ea1354066162be893ee5e25773ab743de3e088cecbb4f31" -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "substrate-bip39" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" dependencies = [ - "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel 0.9.1", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "subtle-ng" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" - -[[package]] -name = "subxt" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "588b8ce92699eeb06290f4fb02dad4f7e426c4e6db4d53889c6bcbc808cf24ac" -dependencies = [ - "async-trait", - "base58", - "blake2", - "derivative", - "either", - "frame-metadata 16.0.0", - "futures", - "hex", - "impl-serde", - "jsonrpsee 0.20.3", - "parity-scale-codec", - "primitive-types", - "scale-bits", - "scale-decode", - "scale-encode", - "scale-info", - "scale-value", - "serde", - "serde_json", - "sp-core-hashing 9.0.0", - "subxt-lightclient", - "subxt-macro", - "subxt-metadata", - "thiserror", - "tracing", -] - -[[package]] -name = "subxt-codegen" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98f5a534c8d475919e9c845d51fc2316da4fcadd04fe17552d932d2106de930e" -dependencies = [ - "frame-metadata 16.0.0", - "heck", - "hex", - "jsonrpsee 0.20.3", - "parity-scale-codec", - "proc-macro2", - "quote", - "scale-info", - "subxt-metadata", - "syn 2.0.37", - "thiserror", - "tokio", -] - -[[package]] -name = "subxt-lightclient" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10fd0ac9b091211f962b6ae19e26cd08e0b86efa064dfb7fac69c8f79f122329" -dependencies = [ - "futures", - "futures-util", - "serde", - "serde_json", - "smoldot-light", - "thiserror", - "tokio", - "tokio-stream", - "tracing", -] - -[[package]] -name = "subxt-macro" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12e8be9ab6fe88b8c13edbe15911e148482cfb905a8b8d5b8d766a64c54be0bd" -dependencies = [ - "darling 0.20.3", - "proc-macro-error", - "subxt-codegen", - "syn 2.0.37", -] - -[[package]] -name = "subxt-metadata" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6898275765d36a37e5ef564358e0341cf41b5f3a91683d7d8b859381b65ac8a" -dependencies = [ - "frame-metadata 16.0.0", - "parity-scale-codec", - "scale-info", - "sp-core-hashing 9.0.0", - "thiserror", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tamagotchi" -version = "0.3.3" -dependencies = [ - "gear-wasm-builder", - "gstd", - "gtest", - "tamagotchi-io", -] - -[[package]] -name = "tamagotchi-army" -version = "0.3.3" -dependencies = [ - "gear-wasm-builder", - "gstd", - "gtest", - "tamagotchi-army-io", -] - -[[package]] -name = "tamagotchi-army-io" -version = "0.3.3" -dependencies = [ - "gmeta", - "gstd", -] - -[[package]] -name = "tamagotchi-auto" -version = "0.3.3" -dependencies = [ - "gear-wasm-builder", - "gstd", - "tamagotchi-auto-io", -] - -[[package]] -name = "tamagotchi-auto-io" -version = "0.3.3" -dependencies = [ - "gmeta", - "gstd", -] - -[[package]] -name = "tamagotchi-interaction" -version = "0.3.3" -dependencies = [ - "gear-wasm-builder", - "gstd", - "gtest", - "tamagotchi-interaction-io", -] - -[[package]] -name = "tamagotchi-interaction-io" -version = "0.3.3" -dependencies = [ - "gmeta", - "gstd", + "hmac 0.11.0", + "pbkdf2 0.8.0", + "schnorrkel", + "sha2 0.9.9", + "zeroize", ] [[package]] -name = "tamagotchi-io" -version = "0.3.3" -dependencies = [ - "gmeta", - "gstd", -] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] -name = "tamagotchi-nft" -version = "0.3.3" +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "gear-wasm-builder", - "gstd", - "gtest", - "tamagotchi-nft-io", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "tamagotchi-nft-io" -version = "0.3.3" +name = "syn" +version = "2.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ - "gmeta", - "gstd", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "tamagotchi-shop" +name = "tamagotchi" version = "0.3.3" dependencies = [ "gear-wasm-builder", "gstd", - "tamagotchi-shop-io", + "gtest", + "tamagotchi-io", ] [[package]] -name = "tamagotchi-shop-io" +name = "tamagotchi-io" version = "0.3.3" dependencies = [ "gmeta", @@ -5769,7 +3930,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", - "fastrand 2.0.1", + "fastrand", "redox_syscall 0.3.5", "rustix 0.38.15", "windows-sys 0.48.0", @@ -5793,26 +3954,6 @@ dependencies = [ "thiserror-impl", ] -[[package]] -name = "thiserror-core" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c001ee18b7e5e3f62cbf58c7fe220119e68d902bb7443179c0c8aef30090e999" -dependencies = [ - "thiserror-core-impl", -] - -[[package]] -name = "thiserror-core-impl" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", -] - [[package]] name = "thiserror-impl" version = "1.0.49" @@ -5853,15 +3994,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -5877,70 +4009,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "tokio" -version = "1.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "socket2 0.5.4", - "tokio-macros", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-macros" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" -dependencies = [ - "bytes", - "futures-core", - "futures-io", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - [[package]] name = "toml" version = "0.7.8" @@ -5975,33 +4043,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - [[package]] name = "tracing" version = "0.1.37" @@ -6101,12 +4142,6 @@ dependencies = [ "hash-db", ] -[[package]] -name = "try-lock" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" - [[package]] name = "tt-call" version = "1.0.9" @@ -6176,36 +4211,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "universal-hash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" -dependencies = [ - "crypto-common", - "subtle", -] - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "upload" -version = "0.3.3" -dependencies = [ - "gclient", - "gear-core", - "gsdk", - "sharded-fungible-token", - "sharded-fungible-token-io", - "sharded-fungible-token-logic", - "sharded-fungible-token-storage", - "tokio", -] - [[package]] name = "url" version = "2.4.1" @@ -6235,44 +4240,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wabt" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00bef93d5e6c81a293bccf107cf43aa47239382f455ba14869d36695d8963b9c" -dependencies = [ - "serde", - "serde_derive", - "serde_json", - "wabt-sys", -] - -[[package]] -name = "wabt-sys" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a4e043159f63e16986e713e9b5e1c06043df4848565bf672e27c523864c7791" -dependencies = [ - "cc", - "cmake", - "glob", -] - -[[package]] -name = "waker-fn" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -6630,20 +4597,6 @@ dependencies = [ "wasmi_core 0.2.1", ] -[[package]] -name = "wasmi" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51fb5c61993e71158abf5bb863df2674ca3ec39ed6471c64f07aeaf751d67b4" -dependencies = [ - "intx", - "smallvec", - "spin 0.9.8", - "wasmi_arena 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmi_core 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmparser-nostd", -] - [[package]] name = "wasmi" version = "0.30.0" @@ -6651,9 +4604,9 @@ source = "git+https://github.com/gear-tech/wasmi?branch=gear-v0.30.0#c8b0be9c201 dependencies = [ "intx", "smallvec", - "spin 0.9.8", - "wasmi_arena 0.4.0 (git+https://github.com/gear-tech/wasmi?branch=gear-v0.30.0)", - "wasmi_core 0.12.0 (git+https://github.com/gear-tech/wasmi?branch=gear-v0.30.0)", + "spin", + "wasmi_arena", + "wasmi_core 0.12.0", "wasmparser-nostd", ] @@ -6665,12 +4618,6 @@ dependencies = [ "parity-wasm 0.45.0 (git+https://github.com/gear-tech/parity-wasm?branch=v0.45.0-sign-ext)", ] -[[package]] -name = "wasmi_arena" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" - [[package]] name = "wasmi_arena" version = "0.4.0" @@ -6689,18 +4636,6 @@ dependencies = [ "region", ] -[[package]] -name = "wasmi_core" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624e6333e861ef49095d2d678b76ebf30b06bf37effca845be7e5b87c90071b7" -dependencies = [ - "downcast-rs", - "libm", - "num-traits", - "paste", -] - [[package]] name = "wasmi_core" version = "0.12.0" @@ -6891,31 +4826,6 @@ dependencies = [ "wast", ] -[[package]] -name = "web-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" -dependencies = [ - "rustls-webpki 0.100.3", -] - -[[package]] -name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - [[package]] name = "which" version = "4.4.2" @@ -7014,15 +4924,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.0", -] - [[package]] name = "windows-targets" version = "0.42.2" @@ -7053,21 +4954,6 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] -[[package]] -name = "windows-targets" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" -dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", -] - [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -7080,12 +4966,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" - [[package]] name = "windows_aarch64_msvc" version = "0.33.0" @@ -7104,12 +4984,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - [[package]] name = "windows_i686_gnu" version = "0.33.0" @@ -7128,12 +5002,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" -[[package]] -name = "windows_i686_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" - [[package]] name = "windows_i686_msvc" version = "0.33.0" @@ -7152,12 +5020,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" -[[package]] -name = "windows_i686_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - [[package]] name = "windows_x86_64_gnu" version = "0.33.0" @@ -7176,12 +5038,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" - [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -7194,12 +5050,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" - [[package]] name = "windows_x86_64_msvc" version = "0.33.0" @@ -7218,12 +5068,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" - [[package]] name = "winnow" version = "0.5.15" @@ -7242,12 +5086,6 @@ dependencies = [ "tap", ] -[[package]] -name = "yap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4524214bc4629eba08d78ceb1d6507070cc0bcbbed23af74e19e6e924a24cf" - [[package]] name = "zeroize" version = "1.6.0" diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 70a1424d..d7a9e71a 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -10,13 +10,6 @@ publish = false resolver = "2" members = [ "01-tamagotchi", - "02-tamagotchi-interaction", - "03-tamagotchi-nft", - "04-tamagotchi-shop", - "04-tamagotchi-shop/store", - "04-tamagotchi-shop/upload", - "05-tamagotchi-auto", - "06-tamagotchi-army", ] [workspace.dependencies] @@ -30,12 +23,6 @@ gtest = { git = "https://github.com/gear-tech/gear", tag = "v1.0.2" } sharded-fungible-token-io = { git = "https://github.com/gear-foundation/dapps", tag = "v1.0.2" } tamagotchi-io.path = "01-tamagotchi/io" -tamagotchi-interaction-io.path = "02-tamagotchi-interaction/io" -tamagotchi-nft-io.path = "03-tamagotchi-nft/io" -tamagotchi-shop-io.path = "04-tamagotchi-shop/io" -store-io.path = "04-tamagotchi-shop/store/io" -tamagotchi-auto-io.path = "05-tamagotchi-auto/io" -tamagotchi-army-io.path = "06-tamagotchi-army/io" tokio = "1" From d8b06967c553e25eaacb5af86aed9ff10b978e90 Mon Sep 17 00:00:00 2001 From: Jackliu-miaozi <71253778+Jackliu-miaozi@users.noreply.github.com> Date: Mon, 18 Dec 2023 15:40:19 +0800 Subject: [PATCH 6/6] test_success --- contracts/01-tamagotchi/src/lib.rs | 4 ++-- contracts/01-tamagotchi/tests/smoke.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/01-tamagotchi/src/lib.rs b/contracts/01-tamagotchi/src/lib.rs index 8df96e29..9c3d549c 100644 --- a/contracts/01-tamagotchi/src/lib.rs +++ b/contracts/01-tamagotchi/src/lib.rs @@ -9,7 +9,7 @@ static mut TAMAGOTCHI: Option = None; extern fn init() { // TODO: 5️⃣ Initialize the Tamagotchi program let initname = msg::load().expect("unable to load name"); - let birthdate = exec::block_timestamp(); + let birthdate = exec::block_height() as u64; let tmg = Tamagotchi { name: initname, date_of_birth: birthdate, @@ -30,7 +30,7 @@ extern fn handle() { .expect("Error in a reply'tamagotchi::name'"); } TmgAction::Age => { - let age = exec::block_timestamp() - tmg.date_of_birth; + let age = exec::block_height() as u64 - tmg.date_of_birth; msg::reply(TmgEvent::Age(age), 0).expect("Error in a reply'tamagotchi::age'"); } } diff --git a/contracts/01-tamagotchi/tests/smoke.rs b/contracts/01-tamagotchi/tests/smoke.rs index a43733c8..ce5f7950 100644 --- a/contracts/01-tamagotchi/tests/smoke.rs +++ b/contracts/01-tamagotchi/tests/smoke.rs @@ -13,8 +13,8 @@ fn smoke_test() { .dest(2) .payload(TmgEvent::Name(String::from("Goodmorning"))); assert!(result.contains(&log)); - let _result = program.send(2, TmgAction::Age); - // let age = sys.spend_blocks(1); - // let log = Log::builder().dest(2).payload(TmgEvent::Age(age[0])); - // assert!(result.contains(&log)); + sys.spend_blocks(1); + let result = program.send(2, TmgAction::Age); + let log = Log::builder().dest(2).payload(TmgEvent::Age(1)); + assert!(result.contains(&log)); }