Skip to content

Commit

Permalink
refactor!: split executor data model
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
  • Loading branch information
mversic committed Jul 1, 2024
1 parent b69230b commit c2e0461
Show file tree
Hide file tree
Showing 80 changed files with 2,159 additions and 2,085 deletions.
33 changes: 31 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 25 additions & 23 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,34 @@ iroha_core = { version = "=2.0.0-pre-rc.21 ", path = "core" }

irohad = { version = "=2.0.0-pre-rc.21", path = "cli" }
iroha_torii = { version = "=2.0.0-pre-rc.21", path = "torii" }
iroha_torii_derive = { version = "=2.0.0-pre-rc.21", path = "torii/derive" }
iroha_torii_const = { version = "=2.0.0-pre-rc.21", path = "torii/const" }

iroha = { version = "=2.0.0-pre-rc.21", path = "client" }

iroha_macro_utils = { version = "=2.0.0-pre-rc.21", path = "macro/utils" }
iroha_telemetry = { version = "=2.0.0-pre-rc.21", path = "telemetry" }
iroha_telemetry_derive = { version = "=2.0.0-pre-rc.21", path = "telemetry/derive" }
iroha_p2p = { version = "=2.0.0-pre-rc.21", path = "p2p" }
iroha_primitives = { version = "=2.0.0-pre-rc.21", path = "primitives", default-features = false }
iroha_primitives_derive = { version = "=2.0.0-pre-rc.21", path = "primitives/derive" }
iroha_data_model = { version = "=2.0.0-pre-rc.21", path = "data_model", default-features = false }
iroha_data_model_derive = { version = "=2.0.0-pre-rc.21", path = "data_model/derive" }
iroha_config = { version = "=2.0.0-pre-rc.21", path = "config" }
iroha_config_base = { version = "=2.0.0-pre-rc.21", path = "config/base" }
iroha_config_base_derive = { version = "=2.0.0-pre-rc.21", path = "config/base/derive" }
iroha_schema_gen = { version = "=2.0.0-pre-rc.21", path = "schema/gen" }
iroha_schema = { version = "=2.0.0-pre-rc.21", path = "schema", default-features = false }
iroha_schema_derive = { version = "=2.0.0-pre-rc.21", path = "schema/derive" }
iroha_logger = { version = "=2.0.0-pre-rc.21", path = "logger" }
iroha_crypto = { version = "=2.0.0-pre-rc.21", path = "crypto", default-features = false }
iroha_macro = { version = "=2.0.0-pre-rc.21", path = "macro", default-features = false }
iroha_derive = { version = "=2.0.0-pre-rc.21", path = "macro/derive" }
iroha_futures = { version = "=2.0.0-pre-rc.21", path = "futures" }
iroha_futures_derive = { version = "=2.0.0-pre-rc.21", path = "futures/derive" }
iroha_genesis = { version = "=2.0.0-pre-rc.21", path = "genesis" }
iroha_ffi = { version = "=2.0.0-pre-rc.21", path = "ffi" }
iroha_ffi_derive = { version = "=2.0.0-pre-rc.21", path = "ffi/derive" }
iroha_version = { version = "=2.0.0-pre-rc.21", path = "version", default-features = false }
iroha_version_derive = { version = "=2.0.0-pre-rc.21", path = "version/derive", default-features = false }
iroha_wasm_codec = { version = "=2.0.0-pre-rc.21", path = "wasm_codec" }
iroha_wasm_builder = { version = "=2.0.0-pre-rc.21", path = "wasm_builder" }

iroha_smart_contract = { version = "=2.0.0-pre-rc.21", path = "smart_contract" }
iroha_smart_contract_derive = { version = "=2.0.0-pre-rc.21", path = "smart_contract/derive" }
iroha_smart_contract_utils = { version = "=2.0.0-pre-rc.21", path = "smart_contract/utils" }
iroha_executor_derive = { version = "=2.0.0-pre-rc.21", path = "smart_contract/executor/derive" }
iroha_trigger_derive = { version = "=2.0.0-pre-rc.21", path = "smart_contract/trigger/derive" }

iroha_executor = { version = "=2.0.0-pre-rc.21", path = "smart_contract/executor" }
iroha_executor_data_model = { version = "=2.0.0-pre-rc.21", path = "smart_contract/executor/data_model" }

test_network = { version = "=2.0.0-pre-rc.21", path = "core/test_network" }
test_samples = { version = "=2.0.0-pre-rc.21", path = "test_samples" }
Expand Down Expand Up @@ -213,41 +203,53 @@ members = [
"crypto",
"data_model",
"genesis",

"logger",
"p2p",

"futures",
"futures/derive",

"primitives",
"primitives/derive",
"primitives/numeric",

"ffi",
"ffi/derive",
"futures",
"futures/derive",
"logger",
"macro",
"macro/derive",
"macro/utils",
"p2p",

"schema",
"schema/derive",
"schema/gen",
"schema/derive",

"smart_contract",
"smart_contract/derive",
"smart_contract/utils",

"smart_contract/trigger",
"smart_contract/trigger/derive",
"smart_contract/utils",

"smart_contract/executor",
"smart_contract/executor/derive",
"smart_contract/executor/data_model",
"smart_contract/executor/data_model/derive",

"telemetry",
"test_samples",

"tools/swarm",
"tools/kagami",
"tools/kura_inspector",
"tools/parity_scale_cli",
"tools/swarm",
"tools/wasm_builder_cli",
"tools/wasm_test_runner",

"torii",
"torii/derive",
"torii/const",

"version",
"version/derive",

"wasm_codec",
"wasm_codec/derive",
"wasm_builder",
Expand Down
5 changes: 3 additions & 2 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ tls-rustls-webpki-roots = [
iroha_config = { workspace = true }
iroha_config_base = { workspace = true }
iroha_crypto = { workspace = true }
# FIXME: should remove `transparent_api` feature?
# FIXME: should remove `transparent_api` feature. Check the other FIXME comment in dev-dependencies
iroha_data_model = { workspace = true, features = ["http", "transparent_api"] }
iroha_executor_data_model = { workspace = true }
iroha_primitives = { workspace = true }
iroha_logger = { workspace = true }
iroha_telemetry = { workspace = true }
Expand Down Expand Up @@ -82,7 +83,7 @@ toml = { workspace = true }
nonzero_ext = { workspace = true }

[dev-dependencies]
# TODO: These three activate `transparent_api` but client should never activate this feature.
# FIXME: These three activate `transparent_api` but client should never activate this feature.
# Additionally there is a dependency on iroha_core in dev-dependencies in telemetry/derive
# Hopefully, once the integration tests migration is finished these can be removed
irohad = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ pub mod samples {

pub use iroha_crypto as crypto;
pub use iroha_data_model as data_model;
pub use iroha_executor_data_model as executor_data_model;
13 changes: 5 additions & 8 deletions client/tests/integration/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use iroha::{
prelude::*,
transaction::error::TransactionRejectionReason,
},
executor_data_model::permission::asset::CanTransferUserAsset,
};
use iroha_config::parameters::actual::Root as Config;
use serde_json::json;
use test_network::*;
use test_samples::{gen_account_in, ALICE_ID, BOB_ID};

Expand Down Expand Up @@ -295,13 +295,10 @@ fn find_rate_and_make_exchange_isi_should_succeed() {

let alice_id = ALICE_ID.clone();
let alice_can_transfer_asset = |asset_id: AssetId, owner_key_pair: KeyPair| {
let instruction = Grant::permission(
Permission::new(
"CanTransferUserAsset".parse().unwrap(),
json!({ "asset": asset_id }),
),
alice_id.clone(),
);
let permission = CanTransferUserAsset {
asset: asset_id.clone(),
};
let instruction = Grant::permission(permission, alice_id.clone());
let transaction = TransactionBuilder::new(
ChainId::from("00000000-0000-0000-0000-000000000000"),
asset_id.account().clone(),
Expand Down
Loading

0 comments on commit c2e0461

Please sign in to comment.