From 5486900dc13423f4fa7375ad635995a4c47eba1e Mon Sep 17 00:00:00 2001 From: Bai Chuan Date: Wed, 30 Aug 2023 12:22:14 +0800 Subject: [PATCH] make dev as default chain id and fixup warning when CI check (#725) * make dev as default chain id and fixup warning when CI check * remove unused module * fixup module use for testcase --- Cargo.lock | 1 - crates/rooch-config/Cargo.toml | 4 ++-- crates/rooch-framework/sources/coin.move | 6 +++--- crates/rooch-key/Cargo.toml | 4 ++-- crates/rooch-types/Cargo.toml | 4 ++-- crates/rooch-types/src/chain_id.rs | 4 ++-- crates/rooch-types/src/transaction/rooch.rs | 1 - crates/rooch/Cargo.toml | 2 +- examples/private_generics/sources/private_generics.move | 5 ++--- moveos/metrics/Cargo.toml | 2 +- moveos/moveos-commons/accumulator/Cargo.toml | 4 ++-- moveos/moveos-store/Cargo.toml | 3 +-- moveos/moveos-types/Cargo.toml | 4 ++-- 13 files changed, 20 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81e886f4ef..6e72c372d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5196,7 +5196,6 @@ dependencies = [ "accumulator", "anyhow", "bcs", - "bcs-ext", "chrono", "hex", "move-core-types", diff --git a/crates/rooch-config/Cargo.toml b/crates/rooch-config/Cargo.toml index d0af2973b2..db5dd290fe 100644 --- a/crates/rooch-config/Cargo.toml +++ b/crates/rooch-config/Cargo.toml @@ -20,8 +20,8 @@ once_cell = { workspace = true } clap = { workspace = true } dirs-next = { workspace = true } schemars = {workspace = true } -proptest = { default-features = false, optional = true, workspace = true } -proptest-derive = { default-features = false, optional = true, workspace = true } +proptest = { optional = true, workspace = true } +proptest-derive = { optional = true, workspace = true } rooch-key = { workspace = true } rooch-types = { workspace = true } diff --git a/crates/rooch-framework/sources/coin.move b/crates/rooch-framework/sources/coin.move index 88922ce701..d2bfb920d2 100644 --- a/crates/rooch-framework/sources/coin.move +++ b/crates/rooch-framework/sources/coin.move @@ -756,7 +756,7 @@ module rooch_framework::coin { let destination_ctx = storage_context::new_test_context_random(signer::address_of(destination), b"test_tx1"); let mod_account_ctx = storage_context::new_test_context_random(signer::address_of(mod_account), b"test_tx2"); - init_for_test(&mut mod_account_ctx, mod_account); + init_for_test(&mut mod_account_ctx); initialize_entry( &mut mod_account_ctx, mod_account, @@ -808,7 +808,7 @@ module rooch_framework::coin { let destination_ctx = storage_context::new_test_context_random(signer::address_of(destination), b"test_tx1"); let mod_account_ctx = storage_context::new_test_context_random(signer::address_of(mod_account), b"test_tx2"); - init_for_test(&mut mod_account_ctx, mod_account); + init_for_test(&mut mod_account_ctx); initialize_entry(&mut mod_account_ctx, mod_account, b"Fake Coin", b"FCD", 9); init_account_coin_store(&mut mod_account_ctx, mod_account); init_account_coin_store(&mut source_ctx, source); @@ -834,7 +834,7 @@ module rooch_framework::coin { let destination_ctx = storage_context::new_test_context_random(signer::address_of(destination), b"test_tx1"); let mod_account_ctx = storage_context::new_test_context_random(signer::address_of(mod_account), b"test_tx2"); - init_for_test(&mut mod_account_ctx, mod_account); + init_for_test(&mut mod_account_ctx); initialize_entry(&mut mod_account_ctx, mod_account, b"Fake Coin", b"FCD", 9); init_account_coin_store(&mut mod_account_ctx, mod_account); init_account_coin_store(&mut source_ctx, source); diff --git a/crates/rooch-key/Cargo.toml b/crates/rooch-key/Cargo.toml index cb5c77538f..2af9f95f4e 100644 --- a/crates/rooch-key/Cargo.toml +++ b/crates/rooch-key/Cargo.toml @@ -32,8 +32,8 @@ tiny-bip39 = { workspace = true } rooch-types = { workspace = true } move-core-types = { workspace = true } moveos-types = { workspace = true } -proptest = { default-features = false, optional = true, workspace = true } -proptest-derive = { default-features = false, optional = true, workspace = true } +proptest = {optional = true, workspace = true } +proptest-derive = {optional = true, workspace = true } [dev-dependencies] proptest = { workspace = true } diff --git a/crates/rooch-types/Cargo.toml b/crates/rooch-types/Cargo.toml index 872bf36111..42d63fec59 100644 --- a/crates/rooch-types/Cargo.toml +++ b/crates/rooch-types/Cargo.toml @@ -48,8 +48,8 @@ moveos-types = { workspace = true } moveos-stdlib = { workspace = true } moveos = { workspace = true } -proptest = { default-features = false, optional = true, workspace = true } -proptest-derive = { default-features = false, optional = true, workspace = true } +proptest = { optional = true, workspace = true } +proptest-derive = { optional = true, workspace = true } [dev-dependencies] proptest = { workspace = true } diff --git a/crates/rooch-types/src/chain_id.rs b/crates/rooch-types/src/chain_id.rs index 1b4fef363e..f43fedc15e 100644 --- a/crates/rooch-types/src/chain_id.rs +++ b/crates/rooch-types/src/chain_id.rs @@ -77,10 +77,10 @@ impl Into for ChainID { #[repr(u64)] pub enum BuiltinChainID { /// A ephemeral network just for developer test. + #[default] Dev = CHAIN_ID_DEV, - /// Rooch test network, + /// Rooch test network. /// The data on the chain will be cleaned up periodically. - #[default] Test = CHAIN_ID_TEST, /// Rooch main net. Main = CHAIN_ID_MAIN, diff --git a/crates/rooch-types/src/transaction/rooch.rs b/crates/rooch-types/src/transaction/rooch.rs index ad808568b4..7f60767b2e 100644 --- a/crates/rooch-types/src/transaction/rooch.rs +++ b/crates/rooch-types/src/transaction/rooch.rs @@ -118,7 +118,6 @@ impl RoochTransaction { #[cfg(test)] pub fn mock() -> RoochTransaction { use crate::address::RoochSupportedAddress; - use crate::crypto::Signature; use fastcrypto::ed25519::Ed25519KeyPair; use fastcrypto::traits::KeyPair; use move_core_types::{identifier::Identifier, language_storage::ModuleId}; diff --git a/crates/rooch/Cargo.toml b/crates/rooch/Cargo.toml index 1b297ed45a..886765af8f 100644 --- a/crates/rooch/Cargo.toml +++ b/crates/rooch/Cargo.toml @@ -34,10 +34,10 @@ hex = { workspace = true } regex = { workspace = true } serde-reflection = { workspace = true } serde-generate = { workspace = true } -bcs-ext = { package = "bcs-ext", workspace = true } rust-embed = { workspace = true } rocket = { workspace = true } parking_lot = { workspace = true } +bcs-ext = { workspace = true } move-bytecode-utils = { workspace = true } move-binary-format = { workspace = true } diff --git a/examples/private_generics/sources/private_generics.move b/examples/private_generics/sources/private_generics.move index 3c27f7d0e3..60e1b16cb4 100644 --- a/examples/private_generics/sources/private_generics.move +++ b/examples/private_generics/sources/private_generics.move @@ -30,9 +30,8 @@ module rooch_examples::Test1 { } module rooch_examples::Test3 { - use rooch_examples::Test1::Box; - use rooch_examples::Test1::create_box; - use rooch_examples::Test1::box_value; + #[test_only] + use rooch_examples::Test1::{create_box, Box, box_value}; struct InnerData has key, store, drop, copy { v: u64, diff --git a/moveos/metrics/Cargo.toml b/moveos/metrics/Cargo.toml index ce6d44f681..03f98e6b96 100644 --- a/moveos/metrics/Cargo.toml +++ b/moveos/metrics/Cargo.toml @@ -15,7 +15,7 @@ rust-version = { workspace = true } [dependencies] anyhow = { workspace = true } -prometheus = { default-features = false, workspace = true } +prometheus = {workspace = true } serde_json = { features = ["arbitrary_precision"], workspace = true } futures = { optional = true, workspace = true } hyper = { features = ["full"], optional = true, workspace = true } diff --git a/moveos/moveos-commons/accumulator/Cargo.toml b/moveos/moveos-commons/accumulator/Cargo.toml index 93e87d6078..33cbba7289 100644 --- a/moveos/moveos-commons/accumulator/Cargo.toml +++ b/moveos/moveos-commons/accumulator/Cargo.toml @@ -5,8 +5,7 @@ edition = "2021" [dependencies] anyhow = { workspace = true } -bcs-ext = { package = "bcs-ext", workspace = true } -itertools = { default-features = false, workspace = true } +itertools = { workspace = true } log = { workspace = true } lru = { workspace = true } once_cell = { workspace = true } @@ -14,6 +13,7 @@ parking_lot = { workspace = true } serde = { workspace = true } mirai-annotations = { workspace = true } moveos-types = { workspace = true } +bcs-ext = { workspace = true } [dev-dependencies] proptest = { workspace = true } diff --git a/moveos/moveos-store/Cargo.toml b/moveos/moveos-store/Cargo.toml index a703c88d86..1afd2cde85 100644 --- a/moveos/moveos-store/Cargo.toml +++ b/moveos/moveos-store/Cargo.toml @@ -35,5 +35,4 @@ moveos-stdlib = { workspace = true } raw-store = { workspace = true } moveos-common = { workspace = true } moveos-config = { workspace = true } -accumulator = { workspace = true } -bcs-ext = { package = "bcs-ext", workspace = true } \ No newline at end of file +accumulator = { workspace = true } \ No newline at end of file diff --git a/moveos/moveos-types/Cargo.toml b/moveos/moveos-types/Cargo.toml index e65b4edd6e..342f4404a9 100644 --- a/moveos/moveos-types/Cargo.toml +++ b/moveos/moveos-types/Cargo.toml @@ -28,8 +28,8 @@ schemars = { workspace = true } primitive-types = { workspace = true } tiny-keccak = { workspace = true, features = ["keccak", "sha3"] } fastcrypto = { workspace = true } -proptest = { default-features = false, optional = true, workspace = true } -proptest-derive = { default-features = false, optional = true, workspace = true } +proptest = { optional = true, workspace = true } +proptest-derive = { optional = true, workspace = true } move-core-types = { workspace = true } move-resource-viewer = { workspace = true }