Skip to content
Draft
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.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ anyhow = "1.0"
async-trait = "0.1"
bcs = "0.1"
iota-sdk = { git = "https://github.com/iotaledger/iota.git", package = "iota-sdk", tag = "v1.7.0" }
iota_interaction = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.3", default-features = false, package = "iota_interaction" }
iota_interaction_rust = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.3", default-features = false, package = "iota_interaction_rust" }
iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.3", default-features = false, package = "iota_interaction_ts" }
product_common = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.3", default-features = false, package = "product_common" }
iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/full-package-history", default-features = false, package = "iota_interaction" }
iota_interaction_rust = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/full-package-history", default-features = false, package = "iota_interaction_rust" }
iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/full-package-history", default-features = false, package = "iota_interaction_ts" }
product_common = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/full-package-history", default-features = false, package = "product_common" }
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
serde_json = { version = "1.0", default-features = false }
strum = { version = "0.27", default-features = false, features = ["std", "derive"] }
Expand Down
6 changes: 3 additions & 3 deletions bindings/wasm/notarization_wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ async-trait = { version = "0.1", default-features = false }
bcs = "0.1.6"
console_error_panic_hook = { version = "0.1" }
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "69d496c71fb37e3d22fe85e5bbfd4256d61422b9", package = "fastcrypto" }
iota_interaction = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.3", package = "iota_interaction", default-features = false }
iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.3", package = "iota_interaction_ts" }
iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/full-package-history", package = "iota_interaction", default-features = false }
iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/full-package-history", package = "iota_interaction_ts" }
js-sys = { version = "0.3.61" }
prefix-hex = { version = "0.7", default-features = false }
serde = { version = "1.0", features = ["derive"] }
Expand All @@ -37,7 +37,7 @@ wasm-bindgen-futures = { version = "0.4", default-features = false }

[dependencies.product_common]
git = "https://github.com/iotaledger/product-core.git"
tag = "v0.8.3"
branch = "feat/full-package-history"
package = "product_common"
features = ["core-client", "transaction", "bindings", "binding-utils", "gas-station", "default-http-client"]

Expand Down
18 changes: 18 additions & 0 deletions notarization-move/Move.history.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"aliases": {
"mainnet": "6364aad5",
"devnet": "e678123a",
"testnet": "2304aa97"
},
"envs": {
"e678123a": [
"0x0d88bcecde97585d50207a029a85d7ea0bacf73ab741cbaa975a6e279251033a"
],
"2304aa97": [
"0x00412bd469b7f980227c6c574090348239852e43aa07818b315854fdd8a2d25f"
],
"6364aad5": [
"0x909ce9dcd9a5e97b7b8884fac8e018fad9dece348bf73837379b8694ff684cf3"
]
}
}
3 changes: 3 additions & 0 deletions notarization-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ async-trait.workspace = true
iota_interaction = { workspace = true }
product_common = { workspace = true, features = ["transaction", "test-utils"] }

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

[features]
default = ["send-sync"]
send-sync = [
Expand Down
29 changes: 29 additions & 0 deletions notarization-rs/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 = "../notarization-move/Move.lock";
println!("[build.rs] move_lock_path: {move_lock_path}");
let move_history_path = "../notarization-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 notarization-rs/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 super::network_id;
Expand Down Expand Up @@ -162,7 +162,7 @@ impl NotarizationClientReadOnly {
// Use the passed pkg_id to add a new env or override the information of an existing one.
{
let mut registry = package::notarization_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 notarization-rs/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ type PackageRegistryLockMut = RwLockWriteGuard<'static, PackageRegistry>;

/// Global registry for notarization package information.
static NOTARIZATION_PACKAGE_REGISTRY: LazyLock<RwLock<PackageRegistry>> = LazyLock::new(|| {
let move_lock_content = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../notarization-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"),
"/../notarization-move/Move.history.json"
));
RwLock::new(
PackageRegistry::from_package_history_json_str(package_history_json)
.expect("Move.history.json exists and it's valid"),
)
});

/// Returns a read lock to the package registry.
Expand Down
Loading