Skip to content

Commit 2fe98c3

Browse files
committed
refactor!: split executor data model
Signed-off-by: Marin Veršić <[email protected]>
1 parent 77f68c5 commit 2fe98c3

File tree

81 files changed

+2288
-2140
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2288
-2140
lines changed

Cargo.lock

+31-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+25-23
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,34 @@ iroha_core = { version = "=2.0.0-pre-rc.21 ", path = "core" }
1818

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

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

2625
iroha_macro_utils = { version = "=2.0.0-pre-rc.21", path = "macro/utils" }
2726
iroha_telemetry = { version = "=2.0.0-pre-rc.21", path = "telemetry" }
28-
iroha_telemetry_derive = { version = "=2.0.0-pre-rc.21", path = "telemetry/derive" }
2927
iroha_p2p = { version = "=2.0.0-pre-rc.21", path = "p2p" }
3028
iroha_primitives = { version = "=2.0.0-pre-rc.21", path = "primitives", default-features = false }
31-
iroha_primitives_derive = { version = "=2.0.0-pre-rc.21", path = "primitives/derive" }
3229
iroha_data_model = { version = "=2.0.0-pre-rc.21", path = "data_model", default-features = false }
33-
iroha_data_model_derive = { version = "=2.0.0-pre-rc.21", path = "data_model/derive" }
3430
iroha_config = { version = "=2.0.0-pre-rc.21", path = "config" }
3531
iroha_config_base = { version = "=2.0.0-pre-rc.21", path = "config/base" }
36-
iroha_config_base_derive = { version = "=2.0.0-pre-rc.21", path = "config/base/derive" }
3732
iroha_schema_gen = { version = "=2.0.0-pre-rc.21", path = "schema/gen" }
3833
iroha_schema = { version = "=2.0.0-pre-rc.21", path = "schema", default-features = false }
39-
iroha_schema_derive = { version = "=2.0.0-pre-rc.21", path = "schema/derive" }
4034
iroha_logger = { version = "=2.0.0-pre-rc.21", path = "logger" }
4135
iroha_crypto = { version = "=2.0.0-pre-rc.21", path = "crypto", default-features = false }
4236
iroha_macro = { version = "=2.0.0-pre-rc.21", path = "macro", default-features = false }
43-
iroha_derive = { version = "=2.0.0-pre-rc.21", path = "macro/derive" }
4437
iroha_futures = { version = "=2.0.0-pre-rc.21", path = "futures" }
45-
iroha_futures_derive = { version = "=2.0.0-pre-rc.21", path = "futures/derive" }
4638
iroha_genesis = { version = "=2.0.0-pre-rc.21", path = "genesis" }
4739
iroha_ffi = { version = "=2.0.0-pre-rc.21", path = "ffi" }
48-
iroha_ffi_derive = { version = "=2.0.0-pre-rc.21", path = "ffi/derive" }
4940
iroha_version = { version = "=2.0.0-pre-rc.21", path = "version", default-features = false }
50-
iroha_version_derive = { version = "=2.0.0-pre-rc.21", path = "version/derive", default-features = false }
5141
iroha_wasm_codec = { version = "=2.0.0-pre-rc.21", path = "wasm_codec" }
5242
iroha_wasm_builder = { version = "=2.0.0-pre-rc.21", path = "wasm_builder" }
5343

5444
iroha_smart_contract = { version = "=2.0.0-pre-rc.21", path = "smart_contract" }
55-
iroha_smart_contract_derive = { version = "=2.0.0-pre-rc.21", path = "smart_contract/derive" }
5645
iroha_smart_contract_utils = { version = "=2.0.0-pre-rc.21", path = "smart_contract/utils" }
57-
iroha_executor_derive = { version = "=2.0.0-pre-rc.21", path = "smart_contract/executor/derive" }
58-
iroha_trigger_derive = { version = "=2.0.0-pre-rc.21", path = "smart_contract/trigger/derive" }
46+
47+
iroha_executor = { version = "=2.0.0-pre-rc.21", path = "smart_contract/executor" }
48+
iroha_executor_data_model = { version = "=2.0.0-pre-rc.21", path = "smart_contract/executor/data_model" }
5949

6050
test_network = { version = "=2.0.0-pre-rc.21", path = "core/test_network" }
6151
test_samples = { version = "=2.0.0-pre-rc.21", path = "test_samples" }
@@ -213,41 +203,53 @@ members = [
213203
"crypto",
214204
"data_model",
215205
"genesis",
206+
207+
"logger",
208+
"p2p",
209+
210+
"futures",
211+
"futures/derive",
212+
216213
"primitives",
217214
"primitives/derive",
218215
"primitives/numeric",
216+
219217
"ffi",
220218
"ffi/derive",
221-
"futures",
222-
"futures/derive",
223-
"logger",
224-
"macro",
225-
"macro/derive",
226-
"macro/utils",
227-
"p2p",
219+
228220
"schema",
229-
"schema/derive",
230221
"schema/gen",
222+
"schema/derive",
223+
231224
"smart_contract",
232225
"smart_contract/derive",
226+
"smart_contract/utils",
227+
233228
"smart_contract/trigger",
234229
"smart_contract/trigger/derive",
235-
"smart_contract/utils",
230+
236231
"smart_contract/executor",
237232
"smart_contract/executor/derive",
233+
"smart_contract/executor/data_model",
234+
"smart_contract/executor/data_model/derive",
235+
238236
"telemetry",
239237
"test_samples",
238+
239+
"tools/swarm",
240240
"tools/kagami",
241241
"tools/kura_inspector",
242242
"tools/parity_scale_cli",
243-
"tools/swarm",
244243
"tools/wasm_builder_cli",
245244
"tools/wasm_test_runner",
245+
246246
"torii",
247247
"torii/derive",
248248
"torii/const",
249+
249250
"version",
250251
"version/derive",
252+
251253
"wasm_codec",
252254
"wasm_codec/derive",
253255
"wasm_builder",

cli/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ You may deploy Iroha as a [native binary](#native-binary) or by using [Docker](#
112112

113113
We provide a sample configuration for Docker in [`docker-compose.yml`](../configs/swarm/docker-compose.yml). We highly recommend that you adjust the `config.json` to include a set of new key pairs.
114114

115-
[Generate the keys](#generating-keys) and put them into `services.*.environment` in `docker-compose.yml`. Don't forget to update the public keys of `SUMERAGI_TRUSTED_PEERS`.
115+
[Generate the keys](#generating-keys) and put them into `services.*.environment` in `docker-compose.yml`. Don't forget to update the public keys of `TRUSTED_PEERS`.
116116

117117
- Build images:
118118

client/Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ tls-rustls-webpki-roots = [
5151
iroha_config = { workspace = true }
5252
iroha_config_base = { workspace = true }
5353
iroha_crypto = { workspace = true }
54-
# FIXME: should remove `transparent_api` feature?
54+
# FIXME: should remove `transparent_api` feature. Check the other FIXME comment in dev-dependencies
5555
iroha_data_model = { workspace = true, features = ["http", "transparent_api"] }
56+
iroha_executor_data_model = { workspace = true }
5657
iroha_primitives = { workspace = true }
5758
iroha_logger = { workspace = true }
5859
iroha_telemetry = { workspace = true }
@@ -82,7 +83,7 @@ toml = { workspace = true }
8283
nonzero_ext = { workspace = true }
8384

8485
[dev-dependencies]
85-
# TODO: These three activate `transparent_api` but client should never activate this feature.
86+
# FIXME: These three activate `transparent_api` but client should never activate this feature.
8687
# Additionally there is a dependency on iroha_core in dev-dependencies in telemetry/derive
8788
# Hopefully, once the integration tests migration is finished these can be removed
8889
irohad = { workspace = true }

client/tests/integration/asset.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use iroha::{
1212
},
1313
};
1414
use iroha_config::parameters::actual::Root as Config;
15-
use serde_json::json;
15+
use iroha_executor_data_model::permission::asset::CanTransferUserAsset;
1616
use test_network::*;
1717
use test_samples::{gen_account_in, ALICE_ID, BOB_ID};
1818

@@ -295,13 +295,10 @@ fn find_rate_and_make_exchange_isi_should_succeed() {
295295

296296
let alice_id = ALICE_ID.clone();
297297
let alice_can_transfer_asset = |asset_id: AssetId, owner_key_pair: KeyPair| {
298-
let instruction = Grant::permission(
299-
Permission::new(
300-
"CanTransferUserAsset".parse().unwrap(),
301-
json!({ "asset": asset_id }),
302-
),
303-
alice_id.clone(),
304-
);
298+
let permission = CanTransferUserAsset {
299+
asset: asset_id.clone(),
300+
};
301+
let instruction = Grant::account_permission(permission, alice_id.clone());
305302
let transaction = TransactionBuilder::new(
306303
ChainId::from("00000000-0000-0000-0000-000000000000"),
307304
asset_id.account().clone(),

0 commit comments

Comments
 (0)