Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ async-trait = "0.1"
bcs = "0.1"
chrono = { version = "0.4", features = ["serde"] }
iota-sdk = { package = "iota-sdk", git = "https://github.com/iotaledger/iota.git", tag = "v1.10.0" }
iota_interaction = { package = "iota_interaction", git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.5", default-features = false }
iota_interaction_rust = { package = "iota_interaction_rust", git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.5", default-features = false }
iota_interaction_ts = { package = "iota_interaction_ts", git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.5", default-features = false }
product_common = { package = "product_common", git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.5", default-features = false }
iota_interaction = { package = "iota_interaction", git = "https://github.com/iotaledger/product-core.git", branch = "feat/full-package-history", default-features = false }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to use a feature branch in case, when we will need to increment the IOTA sdk in product core?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it seems that I invited you for a review unknowingly. But, yes, this won't be merged until we have a tag.

iota_interaction_rust = { package = "iota_interaction_rust", git = "https://github.com/iotaledger/product-core.git", branch = "feat/full-package-history", default-features = false }
iota_interaction_ts = { package = "iota_interaction_ts", git = "https://github.com/iotaledger/product-core.git", branch = "feat/full-package-history", default-features = false }
product_common = { package = "product_common", git = "https://github.com/iotaledger/product-core.git", branch = "feat/full-package-history", default-features = false }
secret-storage = { git = "https://github.com/iotaledger/secret-storage", tag = "v0.3.0", default-features = false }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
Expand Down
6 changes: 3 additions & 3 deletions bindings/wasm/hierarchies_wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
anyhow = "1.0"
console_error_panic_hook = "0.1"
iota_interaction = { package = "iota_interaction", git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.5", default-features = false }
iota_interaction_ts = { package = "iota_interaction_ts", git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.5" }
iota_interaction = { package = "iota_interaction", git = "https://github.com/iotaledger/product-core.git", branch = "feat/full-package-history", default-features = false }
iota_interaction_ts = { package = "iota_interaction_ts", git = "https://github.com/iotaledger/product-core.git", branch = "feat/full-package-history" }
js-sys = { version = "0.3" }
serde = { version = "1.0", features = ["derive"] }
serde-wasm-bindgen = "0.6"
Expand All @@ -34,7 +34,7 @@ features = ["default-http-client", "gas-station"]
[dependencies.product_common]
package = "product_common"
git = "https://github.com/iotaledger/product-core.git"
tag = "v0.8.5"
branch = "feat/full-package-history"
features = [
"default-http-client",
"binding-utils",
Expand Down
18 changes: 18 additions & 0 deletions hierarchies-move/Move.history.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"aliases": {
"testnet": "2304aa97",
"devnet": "e678123a",
"mainnet": "6364aad5"
},
"envs": {
"e678123a": [
"0x373c0013c63394509b220a70307a54c323729369a574197c19c9c571c64e68be"
],
"2304aa97": [
"0xbaa47178b92a43d08f79c029a385d5aff75e4e1010e12ea5105fe68f4e9ce8ef"
],
"6364aad5": [
"0x0f75165f01198edbc758df00d61440a46300efb639f3a5c33a7c797a8a66d371"
]
}
}
24 changes: 13 additions & 11 deletions hierarchies-rs/hierarchies/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ strum.workspace = true
thiserror.workspace = true
tokio.workspace = true

[dev-dependencies]
async-trait.workspace = true
product_common = { workspace = true, features = ["test-utils", "transaction"] }

[build-dependencies]
product_common = { workspace = true, features = ["move-history-manager"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
iota_interaction = { workspace = true, default-features = false }
iota_interaction_rust = { workspace = true, default-features = false }
Expand All @@ -26,21 +33,16 @@ tokio = { workspace = true }
iota_interaction = { workspace = true, default-features = false }
iota_interaction_ts = { workspace = true }

[dev-dependencies]
async-trait.workspace = true
product_common = { workspace = true, features = ["transaction", "test-utils"] }

[features]
default = ["send-sync"]
# Uses a default HTTP Client instead of a user-provided one.
default-http-client = ["product_common/default-http-client"]
# Enables an high-level integration with IOTA gas-station.
gas-station = ["product_common/gas-station"]
send-sync = [
"send-sync-storage",
"product_common/send-sync",
"iota_interaction/send-sync-transaction",
"product_common/send-sync",
"send-sync-storage",
]
# Enables `Send` + `Sync` bounds for the storage traits.
send-sync-storage = ["secret-storage/send-sync-storage"]

# Enables an high-level integration with IOTA gas-station.
gas-station = ["product_common/gas-station"]
# Uses a default HTTP Client instead of a user-provided one.
default-http-client = ["product_common/default-http-client"]
29 changes: 29 additions & 0 deletions hierarchies-rs/hierarchies/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2020-2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use std::path::PathBuf;

use product_common::move_history_manager::MoveHistoryManager;

fn main() {
let move_lock_path = "../../hierarchies-move/Move.lock";
println!("[build.rs] move_lock_path: {move_lock_path}");
let move_history_path = "../../hierarchies-move/Move.history.json";
println!("[build.rs] move_history_path: {move_history_path}");

MoveHistoryManager::new(
&PathBuf::from(move_lock_path),
&PathBuf::from(move_history_path),
// We will watch the default watch list (`get_default_aliases_to_watch()`) in this build script
// so we leave the `additional_aliases_to_watch` argument vec empty.
// Use for example `vec!["localnet".to_string()]` instead, if you don't want to ignore `localnet`.
vec![],
)
.manage_history_file(|message| {
println!("[build.rs] {}", message);
})
.expect("Successfully managed Move history file");

// Tell Cargo to rerun this build script if the Move.lock file changes.
println!("cargo::rerun-if-changed={move_lock_path}");
}
4 changes: 2 additions & 2 deletions hierarchies-rs/hierarchies/src/client/read_only.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use iota_interaction::types::transaction::{ProgrammableTransaction, TransactionK
use iota_interaction_ts::bindings::WasmIotaClient;
use product_common::core_client::CoreClientReadOnly;
use product_common::network_name::NetworkName;
use product_common::package_registry::{Env, Metadata};
use product_common::package_registry::Env;
use serde::de::DeserializeOwned;

use crate::client::error::ClientError;
Expand Down Expand Up @@ -148,7 +148,7 @@ impl HierarchiesClientReadOnly {
// Use the passed pkg_id to add a new env or override the information of an existing one.
{
let mut registry = package::hierarchies_package_registry_mut().await;
registry.insert_env(Env::new(network.as_ref()), Metadata::from_package_id(package_id));
registry.insert_env(Env::new(network.as_ref()), vec![package_id]);
}

Self::new_internal(client, network).await
Expand Down
10 changes: 8 additions & 2 deletions hierarchies-rs/hierarchies/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ type PackageRegistryLock = RwLockReadGuard<'static, PackageRegistry>;
type PackageRegistryLockMut = RwLockWriteGuard<'static, PackageRegistry>;

static HIERARCHIES_PACKAGE_REGISTRY: LazyLock<RwLock<PackageRegistry>> = LazyLock::new(|| {
let move_lock_content = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../hierarchies-move/Move.lock"));
RwLock::new(PackageRegistry::from_move_lock_content(move_lock_content).expect("Move.lock exists and it's valid"))
let package_history_json = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../hierarchies-move/Move.history.json"
));
RwLock::new(
PackageRegistry::from_package_history_json_str(package_history_json)
.expect("Move.history.json exists and it's valid"),
)
});

pub(crate) async fn hierarchies_package_registry() -> PackageRegistryLock {
Expand Down
Loading