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
2 changes: 2 additions & 0 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
ignore = [
"RUSTSEC-2023-0071", # temporary ignore until fix is provided
"RUSTSEC-2024-0437", # protobuf uncontrolled recursion https://github.com/iotaledger/iota/issues/5861
"RUSTSEC-2026-0194", # should be fixed by next IOTA version
"RUSTSEC-2026-0195", # should be fixed by next IOTA version
]
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ async-trait = "0.1"
bcs = "0.1"
chrono = { version = "0.4", default-features = false }
hyper = "1"
iota-sdk = { git = "https://github.com/iotaledger/iota.git", package = "iota-sdk", tag = "v1.25.0" }
iota-sdk-types = { git = "https://github.com/iotaledger/iota-rust-sdk.git", rev = "35a27488b887e28e844a1e46d7edb78605871155", default-features = false }
iota_interaction = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.21", default-features = false, package = "iota_interaction" }
iota_interaction_rust = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.21", default-features = false, package = "iota_interaction_rust" }
iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.21", default-features = false, package = "iota_interaction_ts" }
product_common = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.8.21", default-features = false, package = "product_common" }
iota-sdk = { git = "https://github.com/iotaledger/iota.git", package = "iota-sdk", tag = "v1.26.1" }
iota-sdk-types = { git = "https://github.com/iotaledger/iota-rust-sdk.git", rev = "36bffd625e1b1d38307eb9e49bd2cb7dd988bb11", default-features = false }
iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/iota-v1.26.1-upstream-merge", default-features = false, package = "iota_interaction" }
iota_interaction_rust = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/iota-v1.26.1-upstream-merge", default-features = false, package = "iota_interaction_rust" }
iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/iota-v1.26.1-upstream-merge", default-features = false, package = "iota_interaction_ts" }
product_common = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/iota-v1.26.1-upstream-merge", default-features = false, package = "product_common" }
secret-storage = { git = "https://github.com/iotaledger/secret-storage.git", tag = "v0.3.0", default-features = false }
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
serde-aux = { version = "4.7.0", default-features = false }
Expand Down
12 changes: 6 additions & 6 deletions audit-trail-move/Move.history.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"aliases": {
"mainnet": "6364aad5",
"devnet": "daf90477",
"testnet": "2304aa97",
"mainnet": "6364aad5"
"testnet": "2304aa97"
},
"envs": {
"2304aa97": [
"0x51368931f28620c7f65b4ae2c5167b42390e69729357a6347be378755b46e7df"
"daf90477": [
"0x42550eab2785cca0f825289176fd92074d92b2ad8bf2f226d24f4f3e16720f84"
],
"6364aad5": [
"0x960d8a375af7bd09d19f08a9648940caf7e76289de90aa258b9e8e30a84f1b8a"
],
"daf90477": [
"0x42550eab2785cca0f825289176fd92074d92b2ad8bf2f226d24f4f3e16720f84"
"2304aa97": [
"0x51368931f28620c7f65b4ae2c5167b42390e69729357a6347be378755b46e7df"
]
}
}
16 changes: 7 additions & 9 deletions audit-trail-rs/src/client/full_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,11 @@ use std::ops::Deref;
use async_trait::async_trait;
#[cfg(not(target_arch = "wasm32"))]
use iota_interaction::IotaClient;
use iota_interaction::types::base_types::IotaAddress;
use iota_interaction::types::crypto::PublicKey;
use iota_interaction::types::transaction::ProgrammableTransaction;
use iota_interaction::{IotaKeySignature, OptionalSync};
#[cfg(target_arch = "wasm32")]
use iota_interaction_ts::bindings::WasmIotaClient as IotaClient;
use iota_sdk_types::ObjectId;
use iota_sdk_types::{Address, ObjectId, ProgrammableTransaction};
use product_common::core_client::{CoreClient, CoreClientReadOnly};
use product_common::network_name::NetworkName;
use secret_storage::Signer;
Expand Down Expand Up @@ -265,7 +263,7 @@ impl<S> AuditTrailClient<S> {
/// the initial admin.
pub fn create_trail(&self) -> AuditTrailBuilder {
AuditTrailBuilder {
admin: self.public_key.as_ref().map(IotaAddress::from),
admin: self.public_key.as_ref().map(Address::from),
..AuditTrailBuilder::default()
}
}
Expand All @@ -280,10 +278,10 @@ where
self.public_key.as_ref().expect("public_key is set")
}

/// Returns the [IotaAddress] wrapped by this client.
/// Returns the [Address] wrapped by this client.
#[inline(always)]
pub fn address(&self) -> IotaAddress {
IotaAddress::from(self.public_key())
pub fn address(&self) -> Address {
Address::from(self.public_key())
}
}

Expand Down Expand Up @@ -317,8 +315,8 @@ where
&self.signer
}

fn sender_address(&self) -> IotaAddress {
IotaAddress::from(self.public_key())
fn sender_address(&self) -> Address {
Address::from(self.public_key())
}

fn sender_public_key(&self) -> &PublicKey {
Expand Down
6 changes: 2 additions & 4 deletions audit-trail-rs/src/client/read_only.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ use std::ops::Deref;
#[cfg(not(target_arch = "wasm32"))]
use iota_interaction::IotaClient;
use iota_interaction::IotaClientTrait;
use iota_interaction::types::base_types::IotaAddress;
use iota_interaction::types::transaction::{ProgrammableTransaction, TransactionKind};
#[cfg(target_arch = "wasm32")]
use iota_interaction_ts::bindings::WasmIotaClient;
use iota_sdk_types::ObjectId;
use iota_sdk_types::{Address, ObjectId, ProgrammableTransaction, TransactionKind};
use product_common::core_client::CoreClientReadOnly;
use product_common::network_name::NetworkName;
use serde::de::DeserializeOwned;
Expand Down Expand Up @@ -196,7 +194,7 @@ impl AuditTrailReadOnly for AuditTrailClientReadOnly {
let inspection_result = self
.iota_client
.read_api()
.dev_inspect_transaction_block(IotaAddress::ZERO, TransactionKind::Programmable(tx), None, None, None)
.dev_inspect_transaction_block(Address::ZERO, TransactionKind::Programmable(tx), None, None, None)
.await
.map_err(|err| Error::UnexpectedApiResponse(format!("Failed to inspect transaction block: {err}")))?;

Expand Down
21 changes: 10 additions & 11 deletions audit-trail-rs/src/core/access/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
//! These helpers encode Rust-side access inputs into the exact Move call shapes expected by the audit-trail
//! package and apply the lightweight preflight checks that are cheaper to surface before submission.

use iota_interaction::types::base_types::IotaAddress;
use iota_interaction::types::transaction::{CallArg, ProgrammableTransaction};
use iota_interaction::types::transaction::CallArg;
use iota_interaction::{OptionalSync, ident_str};
use iota_sdk_types::ObjectId;
use iota_sdk_types::{Address, ObjectId, ProgrammableTransaction};
use product_common::core_client::CoreClientReadOnly;

use crate::core::internal::{trail as trail_reader, tx};
Expand All @@ -32,7 +31,7 @@ impl AccessOps {
pub(super) async fn create_role<C>(
client: &C,
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
name: String,
permissions: PermissionSet,
role_tags: Option<RoleTags>,
Expand Down Expand Up @@ -85,7 +84,7 @@ impl AccessOps {
pub(super) async fn update_role<C>(
client: &C,
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
name: String,
permissions: PermissionSet,
role_tags: Option<RoleTags>,
Expand Down Expand Up @@ -139,7 +138,7 @@ impl AccessOps {
pub(super) async fn delete_role<C>(
client: &C,
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
name: String,
selected_capability_id: Option<ObjectId>,
) -> Result<ProgrammableTransaction, Error>
Expand Down Expand Up @@ -170,7 +169,7 @@ impl AccessOps {
pub(super) async fn issue_capability<C>(
client: &C,
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
role_name: String,
options: CapabilityIssueOptions,
selected_capability_id: Option<ObjectId>,
Expand Down Expand Up @@ -205,7 +204,7 @@ impl AccessOps {
pub(super) async fn revoke_capability<C>(
client: &C,
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
capability_id: ObjectId,
capability_valid_until: Option<u64>,
selected_capability_id: Option<ObjectId>,
Expand Down Expand Up @@ -238,7 +237,7 @@ impl AccessOps {
pub(super) async fn destroy_capability<C>(
client: &C,
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
capability_id: ObjectId,
selected_capability_id: Option<ObjectId>,
) -> Result<ProgrammableTransaction, Error>
Expand Down Expand Up @@ -296,7 +295,7 @@ impl AccessOps {
pub(super) async fn revoke_initial_admin_capability<C>(
client: &C,
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
capability_id: ObjectId,
capability_valid_until: Option<u64>,
selected_capability_id: Option<ObjectId>,
Expand Down Expand Up @@ -329,7 +328,7 @@ impl AccessOps {
pub(super) async fn cleanup_revoked_capabilities<C>(
client: &C,
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
selected_capability_id: Option<ObjectId>,
) -> Result<ProgrammableTransaction, Error>
where
Expand Down
36 changes: 17 additions & 19 deletions audit-trail-rs/src/core/access/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
use async_trait::async_trait;
use iota_interaction::OptionalSync;
use iota_interaction::rpc_types::{IotaTransactionBlockEffects, IotaTransactionBlockEvents};
use iota_interaction::types::base_types::IotaAddress;
use iota_interaction::types::transaction::ProgrammableTransaction;
use iota_sdk_types::ObjectId;
use iota_sdk_types::{Address, ObjectId, ProgrammableTransaction};
use product_common::core_client::CoreClientReadOnly;
use product_common::transaction::transaction_builder::Transaction;
use tokio::sync::OnceCell;
Expand All @@ -37,7 +35,7 @@ use crate::error::Error;
#[derive(Debug, Clone)]
pub struct CreateRole {
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
name: String,
permissions: PermissionSet,
role_tags: Option<RoleTags>,
Expand All @@ -51,7 +49,7 @@ impl CreateRole {
/// `role_tags`, when present, are serialized as Move `record_tags::RoleTags` role data.
pub fn new(
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
name: String,
permissions: PermissionSet,
role_tags: Option<RoleTags>,
Expand Down Expand Up @@ -135,7 +133,7 @@ impl Transaction for CreateRole {
#[derive(Debug, Clone)]
pub struct UpdateRole {
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
name: String,
permissions: PermissionSet,
role_tags: Option<RoleTags>,
Expand All @@ -147,7 +145,7 @@ impl UpdateRole {
/// Creates an `UpdateRole` transaction builder payload.
pub fn new(
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
name: String,
permissions: PermissionSet,
role_tags: Option<RoleTags>,
Expand Down Expand Up @@ -230,15 +228,15 @@ impl Transaction for UpdateRole {
#[derive(Debug, Clone)]
pub struct DeleteRole {
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
name: String,
selected_capability_id: Option<ObjectId>,
cached_ptb: OnceCell<ProgrammableTransaction>,
}

impl DeleteRole {
/// Creates a `DeleteRole` transaction builder payload.
pub fn new(trail_id: ObjectId, owner: IotaAddress, name: String, selected_capability_id: Option<ObjectId>) -> Self {
pub fn new(trail_id: ObjectId, owner: Address, name: String, selected_capability_id: Option<ObjectId>) -> Self {
Self {
trail_id,
owner,
Expand Down Expand Up @@ -312,7 +310,7 @@ impl Transaction for DeleteRole {
#[derive(Debug, Clone)]
pub struct IssueCapability {
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
role: String,
options: CapabilityIssueOptions,
selected_capability_id: Option<ObjectId>,
Expand All @@ -323,7 +321,7 @@ impl IssueCapability {
/// Creates an `IssueCapability` transaction builder payload.
pub fn new(
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
role: String,
options: CapabilityIssueOptions,
selected_capability_id: Option<ObjectId>,
Expand Down Expand Up @@ -403,7 +401,7 @@ impl Transaction for IssueCapability {
#[derive(Debug, Clone)]
pub struct RevokeCapability {
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
capability_id: ObjectId,
capability_valid_until: Option<u64>,
selected_capability_id: Option<ObjectId>,
Expand All @@ -414,7 +412,7 @@ impl RevokeCapability {
/// Creates a `RevokeCapability` transaction builder payload.
pub fn new(
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
capability_id: ObjectId,
capability_valid_until: Option<u64>,
selected_capability_id: Option<ObjectId>,
Expand Down Expand Up @@ -493,7 +491,7 @@ impl Transaction for RevokeCapability {
#[derive(Debug, Clone)]
pub struct DestroyCapability {
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
capability_id: ObjectId,
selected_capability_id: Option<ObjectId>,
cached_ptb: OnceCell<ProgrammableTransaction>,
Expand All @@ -503,7 +501,7 @@ impl DestroyCapability {
/// Creates a `DestroyCapability` transaction builder payload.
pub fn new(
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
capability_id: ObjectId,
selected_capability_id: Option<ObjectId>,
) -> Self {
Expand Down Expand Up @@ -662,7 +660,7 @@ impl Transaction for DestroyInitialAdminCapability {
#[derive(Debug, Clone)]
pub struct RevokeInitialAdminCapability {
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
capability_id: ObjectId,
capability_valid_until: Option<u64>,
selected_capability_id: Option<ObjectId>,
Expand All @@ -673,7 +671,7 @@ impl RevokeInitialAdminCapability {
/// Creates a `RevokeInitialAdminCapability` transaction builder payload.
pub fn new(
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
capability_id: ObjectId,
capability_valid_until: Option<u64>,
selected_capability_id: Option<ObjectId>,
Expand Down Expand Up @@ -757,14 +755,14 @@ impl Transaction for RevokeInitialAdminCapability {
#[derive(Debug, Clone)]
pub struct CleanupRevokedCapabilities {
trail_id: ObjectId,
owner: IotaAddress,
owner: Address,
selected_capability_id: Option<ObjectId>,
cached_ptb: OnceCell<ProgrammableTransaction>,
}

impl CleanupRevokedCapabilities {
/// Creates a `CleanupRevokedCapabilities` transaction builder payload.
pub fn new(trail_id: ObjectId, owner: IotaAddress, selected_capability_id: Option<ObjectId>) -> Self {
pub fn new(trail_id: ObjectId, owner: Address, selected_capability_id: Option<ObjectId>) -> Self {
Self {
trail_id,
owner,
Expand Down
6 changes: 3 additions & 3 deletions audit-trail-rs/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use std::collections::HashSet;

use iota_interaction::types::base_types::IotaAddress;
use iota_sdk_types::Address;
use product_common::transaction::transaction_builder::TransactionBuilder;

use super::types::{Data, ImmutableMetadata, InitialRecord, LockingConfig};
Expand All @@ -31,7 +31,7 @@ use crate::error::Error;
#[derive(Debug, Clone, Default)]
pub struct AuditTrailBuilder {
/// Initial admin address that should receive the initial admin capability.
pub admin: Option<IotaAddress>,
pub admin: Option<Address>,
/// Optional initial record created together with the trail.
pub initial_record: Option<InitialRecord>,
/// Locking rules to apply at creation time.
Expand Down Expand Up @@ -110,7 +110,7 @@ impl AuditTrailBuilder {
}

/// Sets the admin address that receives the initial-admin capability.
pub fn with_admin(mut self, admin: IotaAddress) -> Self {
pub fn with_admin(mut self, admin: Address) -> Self {
self.admin = Some(admin);
self
}
Expand Down
Loading
Loading