diff --git a/Cargo.lock b/Cargo.lock index 33fc39067ec..a7912c5ed7c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3072,7 +3072,6 @@ dependencies = [ "iroha_primitives", "iroha_schema", "iroha_schema_gen", - "iroha_test_samples", "iroha_version", "parity-scale-codec", "serde", diff --git a/crates/iroha/tests/integration/asset.rs b/crates/iroha/tests/asset.rs similarity index 100% rename from crates/iroha/tests/integration/asset.rs rename to crates/iroha/tests/asset.rs diff --git a/crates/iroha/tests/integration/asset_propagation.rs b/crates/iroha/tests/asset_propagation.rs similarity index 100% rename from crates/iroha/tests/integration/asset_propagation.rs rename to crates/iroha/tests/asset_propagation.rs diff --git a/crates/iroha/tests/integration/events/data.rs b/crates/iroha/tests/events/data.rs similarity index 100% rename from crates/iroha/tests/integration/events/data.rs rename to crates/iroha/tests/events/data.rs diff --git a/crates/iroha/tests/integration/events/mod.rs b/crates/iroha/tests/events/mod.rs similarity index 100% rename from crates/iroha/tests/integration/events/mod.rs rename to crates/iroha/tests/events/mod.rs diff --git a/crates/iroha/tests/integration/events/notification.rs b/crates/iroha/tests/events/notification.rs similarity index 100% rename from crates/iroha/tests/integration/events/notification.rs rename to crates/iroha/tests/events/notification.rs diff --git a/crates/iroha/tests/integration/events/pipeline.rs b/crates/iroha/tests/events/pipeline.rs similarity index 100% rename from crates/iroha/tests/integration/events/pipeline.rs rename to crates/iroha/tests/events/pipeline.rs diff --git a/crates/iroha/tests/integration/extra_functional/connected_peers.rs b/crates/iroha/tests/extra_functional/connected_peers.rs similarity index 100% rename from crates/iroha/tests/integration/extra_functional/connected_peers.rs rename to crates/iroha/tests/extra_functional/connected_peers.rs diff --git a/crates/iroha/tests/integration/extra_functional/genesis.rs b/crates/iroha/tests/extra_functional/genesis.rs similarity index 100% rename from crates/iroha/tests/integration/extra_functional/genesis.rs rename to crates/iroha/tests/extra_functional/genesis.rs diff --git a/crates/iroha/tests/integration/extra_functional/mod.rs b/crates/iroha/tests/extra_functional/mod.rs similarity index 100% rename from crates/iroha/tests/integration/extra_functional/mod.rs rename to crates/iroha/tests/extra_functional/mod.rs diff --git a/crates/iroha/tests/integration/extra_functional/multiple_blocks_created.rs b/crates/iroha/tests/extra_functional/multiple_blocks_created.rs similarity index 100% rename from crates/iroha/tests/integration/extra_functional/multiple_blocks_created.rs rename to crates/iroha/tests/extra_functional/multiple_blocks_created.rs diff --git a/crates/iroha/tests/integration/extra_functional/normal.rs b/crates/iroha/tests/extra_functional/normal.rs similarity index 100% rename from crates/iroha/tests/integration/extra_functional/normal.rs rename to crates/iroha/tests/extra_functional/normal.rs diff --git a/crates/iroha/tests/integration/extra_functional/offline_peers.rs b/crates/iroha/tests/extra_functional/offline_peers.rs similarity index 100% rename from crates/iroha/tests/integration/extra_functional/offline_peers.rs rename to crates/iroha/tests/extra_functional/offline_peers.rs diff --git a/crates/iroha/tests/integration/extra_functional/restart_peer.rs b/crates/iroha/tests/extra_functional/restart_peer.rs similarity index 100% rename from crates/iroha/tests/integration/extra_functional/restart_peer.rs rename to crates/iroha/tests/extra_functional/restart_peer.rs diff --git a/crates/iroha/tests/integration/extra_functional/unregister_peer.rs b/crates/iroha/tests/extra_functional/unregister_peer.rs similarity index 100% rename from crates/iroha/tests/integration/extra_functional/unregister_peer.rs rename to crates/iroha/tests/extra_functional/unregister_peer.rs diff --git a/crates/iroha/tests/integration/mod.rs b/crates/iroha/tests/integration/mod.rs deleted file mode 100644 index d0d11bcbaae..00000000000 --- a/crates/iroha/tests/integration/mod.rs +++ /dev/null @@ -1,20 +0,0 @@ -mod asset; -mod asset_propagation; -mod events; -mod extra_functional; -mod multisig; -mod non_mintable; -mod pagination; -mod permissions; -mod queries; -mod roles; -mod set_parameter; -mod sorting; -mod status_response; -mod transfer_asset; -mod transfer_domain; -mod triggers; -mod tx_chain_id; -mod tx_history; -mod tx_rollback; -mod upgrade; diff --git a/crates/iroha/tests/mod.rs b/crates/iroha/tests/mod.rs deleted file mode 100644 index 6d3bbe6043c..00000000000 --- a/crates/iroha/tests/mod.rs +++ /dev/null @@ -1 +0,0 @@ -mod integration; diff --git a/crates/iroha/tests/integration/multisig.rs b/crates/iroha/tests/multisig.rs similarity index 100% rename from crates/iroha/tests/integration/multisig.rs rename to crates/iroha/tests/multisig.rs diff --git a/crates/iroha/tests/integration/non_mintable.rs b/crates/iroha/tests/non_mintable.rs similarity index 100% rename from crates/iroha/tests/integration/non_mintable.rs rename to crates/iroha/tests/non_mintable.rs diff --git a/crates/iroha/tests/integration/pagination.rs b/crates/iroha/tests/pagination.rs similarity index 100% rename from crates/iroha/tests/integration/pagination.rs rename to crates/iroha/tests/pagination.rs diff --git a/crates/iroha/tests/integration/permissions.rs b/crates/iroha/tests/permissions.rs similarity index 100% rename from crates/iroha/tests/integration/permissions.rs rename to crates/iroha/tests/permissions.rs diff --git a/crates/iroha/tests/integration/queries/account.rs b/crates/iroha/tests/queries/account.rs similarity index 100% rename from crates/iroha/tests/integration/queries/account.rs rename to crates/iroha/tests/queries/account.rs diff --git a/crates/iroha/tests/integration/queries/asset.rs b/crates/iroha/tests/queries/asset.rs similarity index 100% rename from crates/iroha/tests/integration/queries/asset.rs rename to crates/iroha/tests/queries/asset.rs diff --git a/crates/iroha/tests/integration/queries/mod.rs b/crates/iroha/tests/queries/mod.rs similarity index 100% rename from crates/iroha/tests/integration/queries/mod.rs rename to crates/iroha/tests/queries/mod.rs diff --git a/crates/iroha/tests/integration/queries/query_errors.rs b/crates/iroha/tests/queries/query_errors.rs similarity index 100% rename from crates/iroha/tests/integration/queries/query_errors.rs rename to crates/iroha/tests/queries/query_errors.rs diff --git a/crates/iroha/tests/integration/queries/role.rs b/crates/iroha/tests/queries/role.rs similarity index 100% rename from crates/iroha/tests/integration/queries/role.rs rename to crates/iroha/tests/queries/role.rs diff --git a/crates/iroha/tests/integration/queries/smart_contract.rs b/crates/iroha/tests/queries/smart_contract.rs similarity index 100% rename from crates/iroha/tests/integration/queries/smart_contract.rs rename to crates/iroha/tests/queries/smart_contract.rs diff --git a/crates/iroha/tests/integration/roles.rs b/crates/iroha/tests/roles.rs similarity index 100% rename from crates/iroha/tests/integration/roles.rs rename to crates/iroha/tests/roles.rs diff --git a/crates/iroha/tests/integration/set_parameter.rs b/crates/iroha/tests/set_parameter.rs similarity index 100% rename from crates/iroha/tests/integration/set_parameter.rs rename to crates/iroha/tests/set_parameter.rs diff --git a/crates/iroha/tests/integration/sorting.rs b/crates/iroha/tests/sorting.rs similarity index 100% rename from crates/iroha/tests/integration/sorting.rs rename to crates/iroha/tests/sorting.rs diff --git a/crates/iroha/tests/integration/status_response.rs b/crates/iroha/tests/status_response.rs similarity index 100% rename from crates/iroha/tests/integration/status_response.rs rename to crates/iroha/tests/status_response.rs diff --git a/crates/iroha/tests/integration/transfer_asset.rs b/crates/iroha/tests/transfer_asset.rs similarity index 100% rename from crates/iroha/tests/integration/transfer_asset.rs rename to crates/iroha/tests/transfer_asset.rs diff --git a/crates/iroha/tests/integration/transfer_domain.rs b/crates/iroha/tests/transfer_domain.rs similarity index 100% rename from crates/iroha/tests/integration/transfer_domain.rs rename to crates/iroha/tests/transfer_domain.rs diff --git a/crates/iroha/tests/integration/triggers/by_call_trigger.rs b/crates/iroha/tests/triggers/by_call_trigger.rs similarity index 100% rename from crates/iroha/tests/integration/triggers/by_call_trigger.rs rename to crates/iroha/tests/triggers/by_call_trigger.rs diff --git a/crates/iroha/tests/integration/triggers/data_trigger.rs b/crates/iroha/tests/triggers/data_trigger.rs similarity index 100% rename from crates/iroha/tests/integration/triggers/data_trigger.rs rename to crates/iroha/tests/triggers/data_trigger.rs diff --git a/crates/iroha/tests/integration/triggers/event_trigger.rs b/crates/iroha/tests/triggers/event_trigger.rs similarity index 100% rename from crates/iroha/tests/integration/triggers/event_trigger.rs rename to crates/iroha/tests/triggers/event_trigger.rs diff --git a/crates/iroha/tests/integration/triggers/mod.rs b/crates/iroha/tests/triggers/mod.rs similarity index 100% rename from crates/iroha/tests/integration/triggers/mod.rs rename to crates/iroha/tests/triggers/mod.rs diff --git a/crates/iroha/tests/integration/triggers/orphans.rs b/crates/iroha/tests/triggers/orphans.rs similarity index 100% rename from crates/iroha/tests/integration/triggers/orphans.rs rename to crates/iroha/tests/triggers/orphans.rs diff --git a/crates/iroha/tests/integration/triggers/time_trigger.rs b/crates/iroha/tests/triggers/time_trigger.rs similarity index 100% rename from crates/iroha/tests/integration/triggers/time_trigger.rs rename to crates/iroha/tests/triggers/time_trigger.rs diff --git a/crates/iroha/tests/integration/triggers/trigger_rollback.rs b/crates/iroha/tests/triggers/trigger_rollback.rs similarity index 100% rename from crates/iroha/tests/integration/triggers/trigger_rollback.rs rename to crates/iroha/tests/triggers/trigger_rollback.rs diff --git a/crates/iroha/tests/integration/tx_chain_id.rs b/crates/iroha/tests/tx_chain_id.rs similarity index 100% rename from crates/iroha/tests/integration/tx_chain_id.rs rename to crates/iroha/tests/tx_chain_id.rs diff --git a/crates/iroha/tests/integration/tx_history.rs b/crates/iroha/tests/tx_history.rs similarity index 100% rename from crates/iroha/tests/integration/tx_history.rs rename to crates/iroha/tests/tx_history.rs diff --git a/crates/iroha/tests/integration/tx_rollback.rs b/crates/iroha/tests/tx_rollback.rs similarity index 100% rename from crates/iroha/tests/integration/tx_rollback.rs rename to crates/iroha/tests/tx_rollback.rs diff --git a/crates/iroha/tests/ui_fail/cant_filter_singular_query.rs b/crates/iroha/tests/ui_fail/cant_filter_singular_query.rs deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/crates/iroha/tests/integration/upgrade.rs b/crates/iroha/tests/upgrade.rs similarity index 100% rename from crates/iroha/tests/integration/upgrade.rs rename to crates/iroha/tests/upgrade.rs diff --git a/crates/iroha_codec/Cargo.toml b/crates/iroha_codec/Cargo.toml index 694511cabc1..fad92c53da8 100644 --- a/crates/iroha_codec/Cargo.toml +++ b/crates/iroha_codec/Cargo.toml @@ -35,6 +35,3 @@ parity-scale-codec = { workspace = true } serde_json = { workspace = true, features = ["std"]} serde = { workspace = true } eyre = { workspace = true } - -[dev-dependencies] -iroha_test_samples = { workspace = true } diff --git a/crates/iroha_codec/src/main.rs b/crates/iroha_codec/src/main.rs index a6d902131de..2aa7b236eb4 100644 --- a/crates/iroha_codec/src/main.rs +++ b/crates/iroha_codec/src/main.rs @@ -304,19 +304,22 @@ fn list_types(map: &ConverterMap, writer: &mut W) -> Result<()> { #[cfg(test)] mod tests { use iroha_data_model::prelude::*; - use iroha_test_samples::ALICE_ID; use super::*; #[test] fn decode_account_sample() { + let account_id = + "ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland" + .parse() + .unwrap(); let mut metadata = Metadata::default(); metadata.insert( "hat".parse().expect("Valid"), "white".parse::().expect("Valid"), ); - let account = Account::new(ALICE_ID.clone()).with_metadata(metadata); + let account = Account::new(account_id).with_metadata(metadata); decode_sample("account.bin", String::from("NewAccount"), &account); } @@ -337,20 +340,24 @@ mod tests { #[test] fn decode_trigger_sample() { + let account_id = + "ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland" + .parse::() + .unwrap(); let rose_definition_id = AssetDefinitionId::new( "wonderland".parse().expect("Valid"), "rose".parse().expect("Valid"), ); - let rose_id = AssetId::new(rose_definition_id, ALICE_ID.clone()); + let rose_id = AssetId::new(rose_definition_id, account_id.clone()); let trigger_id = "mint_rose".parse().expect("Valid"); let action = Action::new( vec![Mint::asset_numeric(1u32, rose_id)], Repeats::Indefinitely, - ALICE_ID.clone(), + account_id, DomainEventFilter::new().for_events(DomainEventSet::AnyAccount), ); - let trigger = Trigger::new(trigger_id, action); + let trigger = Trigger::new(trigger_id, action); decode_sample("trigger.bin", String::from("Trigger"), &trigger); } diff --git a/crates/iroha_core/benches/blocks/apply_blocks.rs b/crates/iroha_core/benches/blocks/apply_blocks.rs index fbbec3afbad..fb6068bd6c8 100644 --- a/crates/iroha_core/benches/blocks/apply_blocks.rs +++ b/crates/iroha_core/benches/blocks/apply_blocks.rs @@ -1,3 +1,7 @@ +#[path = "./common/mod.rs"] +mod common; + +use common::*; use eyre::Result; use iroha_core::{ block::CommittedBlock, prelude::*, state::State, sumeragi::network_topology::Topology, @@ -5,11 +9,6 @@ use iroha_core::{ use iroha_data_model::peer::PeerId; use iroha_test_samples::gen_account_in; -#[path = "./common.rs"] -mod common; - -use common::*; - pub struct StateApplyBlocks { state: State, blocks: Vec, diff --git a/crates/iroha_core/benches/blocks/common.rs b/crates/iroha_core/benches/blocks/common/mod.rs similarity index 100% rename from crates/iroha_core/benches/blocks/common.rs rename to crates/iroha_core/benches/blocks/common/mod.rs diff --git a/crates/iroha_core/benches/blocks/validate_blocks.rs b/crates/iroha_core/benches/blocks/validate_blocks.rs index 4782876c609..59d59d1bf09 100644 --- a/crates/iroha_core/benches/blocks/validate_blocks.rs +++ b/crates/iroha_core/benches/blocks/validate_blocks.rs @@ -1,11 +1,10 @@ -use iroha_core::{prelude::*, state::State, sumeragi::network_topology::Topology}; -use iroha_data_model::{isi::InstructionBox, prelude::*}; -use iroha_test_samples::gen_account_in; - -#[path = "./common.rs"] +#[path = "./common/mod.rs"] mod common; use common::*; +use iroha_core::{prelude::*, state::State, sumeragi::network_topology::Topology}; +use iroha_data_model::{isi::InstructionBox, prelude::*}; +use iroha_test_samples::gen_account_in; pub struct StateValidateBlocks { state: State, diff --git a/crates/iroha_ffi/src/ir.rs b/crates/iroha_ffi/src/ir.rs index 3d84f84a7ac..4cbbd9293ca 100644 --- a/crates/iroha_ffi/src/ir.rs +++ b/crates/iroha_ffi/src/ir.rs @@ -124,14 +124,26 @@ pub trait IrTypeFamily { } impl IrTypeFamily for R { - type Ref<'itm> = &'itm Self where Self: 'itm; + type Ref<'itm> + = &'itm Self + where + Self: 'itm; // NOTE: Unused - type RefMut<'itm> = () where Self: 'itm; + type RefMut<'itm> + = () + where + Self: 'itm; type Box = Box; type BoxedSlice = Box<[Self]>; - type RefSlice<'itm> = &'itm [Self] where Self: 'itm; + type RefSlice<'itm> + = &'itm [Self] + where + Self: 'itm; // NOTE: Unused - type RefMutSlice<'itm> = () where Self: 'itm; + type RefMutSlice<'itm> + = () + where + Self: 'itm; type Vec = Vec; type Arr = [Self; N]; } @@ -166,22 +178,46 @@ impl IrTypeFamily for Transparent { type Arr = Self; } impl IrTypeFamily for &Extern { - type Ref<'itm> = &'itm Self where Self: 'itm; - type RefMut<'itm> = &'itm mut Self where Self: 'itm; + type Ref<'itm> + = &'itm Self + where + Self: 'itm; + type RefMut<'itm> + = &'itm mut Self + where + Self: 'itm; type Box = Box; type BoxedSlice = Box<[Self]>; - type RefSlice<'itm> = &'itm [Self] where Self: 'itm; - type RefMutSlice<'itm> = &'itm mut [Self] where Self: 'itm; + type RefSlice<'itm> + = &'itm [Self] + where + Self: 'itm; + type RefMutSlice<'itm> + = &'itm mut [Self] + where + Self: 'itm; type Vec = Vec; type Arr = [Self; N]; } impl IrTypeFamily for &mut Extern { - type Ref<'itm> = &'itm Self where Self: 'itm; - type RefMut<'itm> = &'itm mut Self where Self: 'itm; + type Ref<'itm> + = &'itm Self + where + Self: 'itm; + type RefMut<'itm> + = &'itm mut Self + where + Self: 'itm; type Box = Box; type BoxedSlice = Box<[Self]>; - type RefSlice<'itm> = &'itm [Self] where Self: 'itm; - type RefMutSlice<'itm> = &'itm mut [Self] where Self: 'itm; + type RefSlice<'itm> + = &'itm [Self] + where + Self: 'itm; + type RefMutSlice<'itm> + = &'itm mut [Self] + where + Self: 'itm; type Vec = Vec; type Arr = [Self; N]; }