From fe6d2f62b36c3b6169909f26f0be46c5d4ae3763 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 18 Apr 2024 17:04:54 +0200 Subject: [PATCH 1/3] update crates --- client/balance_of_session/Cargo.toml | 4 ++-- client/get_approved_session/Cargo.toml | 4 ++-- client/is_approved_for_all_session/Cargo.toml | 4 ++-- client/mint_session/Cargo.toml | 4 ++-- client/owner_of_session/Cargo.toml | 4 ++-- client/transfer_session/Cargo.toml | 4 ++-- client/updated_receipts/Cargo.toml | 4 ++-- contract/Cargo.toml | 6 +++--- contract/src/main.rs | 8 +++++++- test-contracts/minting_contract/Cargo.toml | 4 ++-- tests/Cargo.toml | 8 ++++---- 11 files changed, 30 insertions(+), 24 deletions(-) diff --git a/client/balance_of_session/Cargo.toml b/client/balance_of_session/Cargo.toml index b2a775a0..9b7e8490 100644 --- a/client/balance_of_session/Cargo.toml +++ b/client/balance_of_session/Cargo.toml @@ -4,8 +4,8 @@ version = "1.5.1" edition = "2018" [dependencies] -casper-contract = "3.0.0" -casper-types = "3.0.0" +casper-contract = "4.0.0" +casper-types = "4.0.1" [[bin]] name = "balance_of_call" diff --git a/client/get_approved_session/Cargo.toml b/client/get_approved_session/Cargo.toml index e28f0197..a697fb34 100644 --- a/client/get_approved_session/Cargo.toml +++ b/client/get_approved_session/Cargo.toml @@ -4,8 +4,8 @@ version = "1.5.1" edition = "2018" [dependencies] -casper-contract = "3.0.0" -casper-types = "3.0.0" +casper-contract = "4.0.0" +casper-types = "4.0.1" [[bin]] name = "get_approved_call" diff --git a/client/is_approved_for_all_session/Cargo.toml b/client/is_approved_for_all_session/Cargo.toml index 14b98280..e64e1fbc 100644 --- a/client/is_approved_for_all_session/Cargo.toml +++ b/client/is_approved_for_all_session/Cargo.toml @@ -4,8 +4,8 @@ version = "1.5.1" edition = "2018" [dependencies] -casper-contract = "3.0.0" -casper-types = "3.0.0" +casper-contract = "4.0.0" +casper-types = "4.0.1" [[bin]] name = "is_approved_for_all_call" diff --git a/client/mint_session/Cargo.toml b/client/mint_session/Cargo.toml index cc09ef29..3673aafe 100644 --- a/client/mint_session/Cargo.toml +++ b/client/mint_session/Cargo.toml @@ -4,8 +4,8 @@ version = "1.5.1" edition = "2018" [dependencies] -casper-contract = "3.0.0" -casper-types = "3.0.0" +casper-contract = "4.0.0" +casper-types = "4.0.1" [[bin]] name = "mint_call" diff --git a/client/owner_of_session/Cargo.toml b/client/owner_of_session/Cargo.toml index b2b8f64f..b6a563e3 100644 --- a/client/owner_of_session/Cargo.toml +++ b/client/owner_of_session/Cargo.toml @@ -4,8 +4,8 @@ version = "1.5.1" edition = "2018" [dependencies] -casper-contract = "3.0.0" -casper-types = "3.0.0" +casper-contract = "4.0.0" +casper-types = "4.0.1" [[bin]] name = "owner_of_call" diff --git a/client/transfer_session/Cargo.toml b/client/transfer_session/Cargo.toml index fa10de71..dbb3cfd0 100644 --- a/client/transfer_session/Cargo.toml +++ b/client/transfer_session/Cargo.toml @@ -6,8 +6,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -casper-contract = "3.0.0" -casper-types = "3.0.0" +casper-contract = "4.0.0" +casper-types = "4.0.1" [[bin]] name = "transfer_call" diff --git a/client/updated_receipts/Cargo.toml b/client/updated_receipts/Cargo.toml index 398c2a61..8f51aef6 100644 --- a/client/updated_receipts/Cargo.toml +++ b/client/updated_receipts/Cargo.toml @@ -6,8 +6,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -casper-contract = "3.0.0" -casper-types = "3.0.0" +casper-contract = "4.0.0" +casper-types = "4.0.1" [[bin]] name = "updated_receipts" diff --git a/contract/Cargo.toml b/contract/Cargo.toml index 3ce3b460..59e4b32f 100644 --- a/contract/Cargo.toml +++ b/contract/Cargo.toml @@ -4,13 +4,13 @@ version = "1.5.1" edition = "2018" [dependencies] -casper-contract = { version = "3.0.0", default-features = false, optional = true } -casper-types = { version = "3.0.0", default-features = false } +casper-contract = { version = "4.0.0", default-features = false, optional = true } +casper-types = { version = "4.0.1", default-features = false } serde = { version = "1.0.80", default-features = false } serde_json = { version = "1.0.59", default-features = false } serde-json-wasm = { version = "0.5.1", default-features = false } base16 = { version = "0.2.1", default-features = false } -casper-event-standard = { version = "0.4.1", default-features = false } +casper-event-standard = { version = "0.5.0", default-features = false } hex = { version = "0.4.3", default-features = false } [[bin]] diff --git a/contract/src/main.rs b/contract/src/main.rs index 6a667e5d..59925b5c 100644 --- a/contract/src/main.rs +++ b/contract/src/main.rs @@ -2445,7 +2445,13 @@ fn generate_entry_points() -> EntryPoints { // data if needed let migrate = EntryPoint::new( ENTRY_POINT_MIGRATE, - vec![Parameter::new(ARG_NFT_PACKAGE_KEY, CLType::Any)], + vec![ + Parameter::new(ARG_NFT_PACKAGE_KEY, CLType::String), + Parameter::new(ARG_EVENTS_MODE, CLType::U8), + Parameter::new(ARG_ACL_PACKAGE_MODE, CLType::Bool), + Parameter::new(ARG_PACKAGE_OPERATOR_MODE, CLType::Bool), + Parameter::new(ARG_OPERATOR_BURN_MODE, CLType::Bool), + ], CLType::Unit, EntryPointAccess::Public, EntryPointType::Contract, diff --git a/test-contracts/minting_contract/Cargo.toml b/test-contracts/minting_contract/Cargo.toml index 5baf93fa..2d19aff0 100644 --- a/test-contracts/minting_contract/Cargo.toml +++ b/test-contracts/minting_contract/Cargo.toml @@ -6,8 +6,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -casper-contract = "3.0.0" -casper-types = "3.0.0" +casper-contract = "4.0.0" +casper-types = "4.0.1" [[bin]] name = "minting_contract" diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 4a09e7af..25fd2dec 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -3,10 +3,10 @@ name = "tests" version = "1.5.1" edition = "2018" [dependencies] -casper-engine-test-support = { version = "5.0.0", default-features = false } +casper-engine-test-support = { version = "7.0.1", default-features = false } contract = { path = "../contract", default-features = false } -casper-execution-engine = { version = "5.0.0", default-features = false } -casper-types = { version = "3.0.0", default-features = false } +casper-execution-engine = { version = "7.0.1", default-features = false } +casper-types = { version = "4.0.1", default-features = false } serde = { version = "1.0.80", default-features = false } serde_json = { version = "1.0.59", default-features = false } once_cell = "1" @@ -14,4 +14,4 @@ blake2 = { version = "0.9.0", default-features = false } base16 = { version = "0.2.1", default-features = false } rand = "0.8.5" sha256 = "1.0.3" -casper-event-standard = { version = "0.4.0", default-features = false } +casper-event-standard = { version = "0.5.0", default-features = false } From 0ae3fb75c7eadb57c181207be412d9315a43c69c Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 18 Apr 2024 20:51:04 +0200 Subject: [PATCH 2/3] stabel in tests --- tests/rust-toolchain | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/rust-toolchain diff --git a/tests/rust-toolchain b/tests/rust-toolchain new file mode 100644 index 00000000..2bf5ad04 --- /dev/null +++ b/tests/rust-toolchain @@ -0,0 +1 @@ +stable From bb475a627b388d2a76e030ee11dd44a8ac77b0cf Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 18 Apr 2024 20:59:46 +0200 Subject: [PATCH 3/3] clippy --- client/balance_of_session/Cargo.toml | 2 +- client/get_approved_session/Cargo.toml | 2 +- client/is_approved_for_all_session/Cargo.toml | 2 +- client/mint_session/Cargo.toml | 2 +- client/owner_of_session/Cargo.toml | 2 +- contract/Cargo.toml | 2 +- rustfmt.toml | 2 +- tests/Cargo.toml | 5 +++-- tests/src/acl.rs | 2 -- tests/src/utility/installer_request_builder.rs | 2 +- 10 files changed, 11 insertions(+), 12 deletions(-) diff --git a/client/balance_of_session/Cargo.toml b/client/balance_of_session/Cargo.toml index 9b7e8490..eff416be 100644 --- a/client/balance_of_session/Cargo.toml +++ b/client/balance_of_session/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "balance_of_session" version = "1.5.1" -edition = "2018" +edition = "2021" [dependencies] casper-contract = "4.0.0" diff --git a/client/get_approved_session/Cargo.toml b/client/get_approved_session/Cargo.toml index a697fb34..668a0dab 100644 --- a/client/get_approved_session/Cargo.toml +++ b/client/get_approved_session/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "get_approved_session" version = "1.5.1" -edition = "2018" +edition = "2021" [dependencies] casper-contract = "4.0.0" diff --git a/client/is_approved_for_all_session/Cargo.toml b/client/is_approved_for_all_session/Cargo.toml index e64e1fbc..6001d482 100644 --- a/client/is_approved_for_all_session/Cargo.toml +++ b/client/is_approved_for_all_session/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "is_approved_for_all_session" version = "1.5.1" -edition = "2018" +edition = "2021" [dependencies] casper-contract = "4.0.0" diff --git a/client/mint_session/Cargo.toml b/client/mint_session/Cargo.toml index 3673aafe..9d7744f6 100644 --- a/client/mint_session/Cargo.toml +++ b/client/mint_session/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "mint_session" version = "1.5.1" -edition = "2018" +edition = "2021" [dependencies] casper-contract = "4.0.0" diff --git a/client/owner_of_session/Cargo.toml b/client/owner_of_session/Cargo.toml index b6a563e3..1062267a 100644 --- a/client/owner_of_session/Cargo.toml +++ b/client/owner_of_session/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "owner_of_session" version = "1.5.1" -edition = "2018" +edition = "2021" [dependencies] casper-contract = "4.0.0" diff --git a/contract/Cargo.toml b/contract/Cargo.toml index 59e4b32f..c4f7eb53 100644 --- a/contract/Cargo.toml +++ b/contract/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "contract" version = "1.5.1" -edition = "2018" +edition = "2021" [dependencies] casper-contract = { version = "4.0.0", default-features = false, optional = true } diff --git a/rustfmt.toml b/rustfmt.toml index 3d2e76e9..b16fb7d5 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,4 +1,4 @@ wrap_comments = true comment_width = 100 imports_granularity = "Crate" -edition = "2018" +edition = "2021" diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 25fd2dec..9b2e4fcd 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -1,8 +1,9 @@ [package] name = "tests" version = "1.5.1" -edition = "2018" -[dependencies] +edition = "2021" + +[dev-dependencies] casper-engine-test-support = { version = "7.0.1", default-features = false } contract = { path = "../contract", default-features = false } casper-execution-engine = { version = "7.0.1", default-features = false } diff --git a/tests/src/acl.rs b/tests/src/acl.rs index 29164771..5709c797 100644 --- a/tests/src/acl.rs +++ b/tests/src/acl.rs @@ -1,5 +1,3 @@ -use core::panic; - use crate::utility::{ constants::{ ACCOUNT_USER_1, ARG_NFT_CONTRACT_HASH, ARG_REVERSE_LOOKUP, CONTRACT_1_0_0_WASM, diff --git a/tests/src/utility/installer_request_builder.rs b/tests/src/utility/installer_request_builder.rs index 0ac3c924..b6535908 100644 --- a/tests/src/utility/installer_request_builder.rs +++ b/tests/src/utility/installer_request_builder.rs @@ -18,7 +18,7 @@ use std::collections::BTreeMap; // Modalities reexports. pub use contract::modalities::{ - EventsMode, MintingMode, NFTHolderMode, NFTKind, OwnershipMode, TokenIdentifier, WhitelistMode, + EventsMode, MintingMode, NFTHolderMode, NFTKind, OwnershipMode, WhitelistMode, }; use super::constants::{NFT_TEST_COLLECTION, NFT_TEST_SYMBOL};